473,390 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

Need Help with this Program.

ASSIGNMENT (4) USING AND MANIPUPATING ARRAYS (Chapter 10 material)

For this assignment you are to:

1) Create and manage arrays
a) One of type integers (containing 10 elements).
b) One of type strings (containing 20 elements).
c) One of type char (containing 30 elements).
2) Search them using (linear AND binary) methods.
3) Sort the arrays. (Selection Sort) From CH(10).
4) Display various results from the (searching/sorting) to standard
output.
YOU ARE FREE TO CHOOSE WHATEVER METHODS YOU WANT FOR THE INPUT
(FILE/STANDARD INPUT).
ATHOUGH FILES MAKE FOR EASIER
TESTING.

FOR THE TESTING/SEARCHING OF THE CHAR array, you should
#include<ctype.h>
and calculate the number of letters/digits in the array.

EXAMPLE:
char x[10] = {'A','a','9','~','1','2','3','Z','G','T');
output would be:
5 alpha characters
4 digit characters
1 non-alphanumeric character.
SKELETON CODE:

#include<iostream>
#include<fstream>
#include<string>
#include<ctype.h>

using namespace std;
I dont get this at all. Its for my class, the input can be a file or
just ask when the program is run. the out put can be in a file or on
the screen as well. It doesnt need to sort all three, just one at a
time. I figure the best bet is to do it as three seperate programs?
so that you do one, it outputs it, do another, output it so on so
forth. Can any one get me started on this please.

Nov 27 '05 #1
8 1574
ho********@aim.com wrote:
ASSIGNMENT (4) USING AND MANIPUPATING ARRAYS (Chapter 10 material)

For this assignment you are to:

1) Create and manage arrays
a) One of type integers (containing 10 elements).
b) One of type strings (containing 20 elements).
c) One of type char (containing 30 elements).
2) Search them using (linear AND binary) methods.
3) Sort the arrays. (Selection Sort) From CH(10).
4) Display various results from the (searching/sorting) to standard
output.
YOU ARE FREE TO CHOOSE WHATEVER METHODS YOU WANT FOR THE INPUT
(FILE/STANDARD INPUT).
ATHOUGH FILES MAKE FOR EASIER
TESTING.

FOR THE TESTING/SEARCHING OF THE CHAR array, you should
#include<ctype.h>
and calculate the number of letters/digits in the array.

EXAMPLE:
char x[10] = {'A','a','9','~','1','2','3','Z','G','T');
output would be:
5 alpha characters
4 digit characters
1 non-alphanumeric character.
SKELETON CODE:

#include<iostream>
#include<fstream>
#include<string>
#include<ctype.h>

using namespace std;
I dont get this at all.

Do you know what an array is?
Do you know hwat integers, strings, and chars are?
Do you know what linear and binary search are?
Do you know what selection sort is?

You see unless you say what you are having trouble with it's very hard
to help.
Its for my class, the input can be a file or
just ask when the program is run. the out put can be in a file or on
the screen as well. It doesnt need to sort all three, just one at a
time. I figure the best bet is to do it as three seperate programs?
That sounds reasonable. If you are allowed to write multiple programs
(and I don't see why not) then I think you could easily write 10
programs to cover all the topics above. Makes much more sense than one
huge program to cover everything.
so that you do one, it outputs it, do another, output it so on so
forth.
I'm not really following that.

Can any one get me started on this please.


Take one tiny part of the assignment (start say with reading one of the
arrays from a file), get that working. Then add another small part (say
linear search), get that working, and so on.

It's obvious from the above description that you have a lot of latitude,
you can really do this in about 10,000 different ways, so pick one, and
start programming.

DO IT IN SMALL STEPS.

john
Nov 27 '05 #2
Hi

ho********@aim.com wrote:
1) Create and manage arrays
a) One of type integers (containing 10 elements).
b) One of type strings (containing 20 elements).
c) One of type char (containing 30 elements).
2) Search them using (linear AND binary) methods.
3) Sort the arrays. (Selection Sort) From CH(10).
4) Display various results from the (searching/sorting) to standard
output. [...] I dont get this at all. Its for my class, the input can be a file or
just ask when the program is run. the out put can be in a file or on
the screen as well. It doesnt need to sort all three, just one at a
time. I figure the best bet is to do it as three seperate programs?
so that you do one, it outputs it, do another, output it so on so
forth.
I think it's better to do it in one program, as you'd end up with a lot of
duplicate code otherwise...
Can any one get me started on this please.


You could start reading
http://www.parashift.com/c++-faq-lit...t.html#faq-5.2

cheers
Markus

Nov 27 '05 #3
<ho********@aim.com> wrote:
ASSIGNMENT (4) USING AND MANIPUPATING ARRAYS (Chapter 10 material)

For this assignment you are to:

1) Create and manage arrays
a) One of type integers (containing 10 elements).
b) One of type strings (containing 20 elements).
c) One of type char (containing 30 elements).
2) Search them using (linear AND binary) methods.
3) Sort the arrays. (Selection Sort) From CH(10).
4) Display various results from the (searching/sorting) to standard
output.
YOU ARE FREE TO CHOOSE WHATEVER METHODS YOU WANT FOR THE INPUT
(FILE/STANDARD INPUT).
ATHOUGH FILES MAKE FOR EASIER
TESTING.

FOR THE TESTING/SEARCHING OF THE CHAR array, you should
#include<ctype.h>
and calculate the number of letters/digits in the array.

EXAMPLE:
char x[10] = {'A','a','9','~','1','2','3','Z','G','T');
output would be:
5 alpha characters
4 digit characters
1 non-alphanumeric character.
SKELETON CODE:

#include<iostream>
#include<fstream>
#include<string>
#include<ctype.h>

using namespace std;
I dont get this at all. Its for my class, the input can be a file or
just ask when the program is run. the out put can be in a file or on
the screen as well.
Perhaps so. But what you posted says the output goes to stdout.

It doesnt need to sort all three, just one at a
time. I figure the best bet is to do it as three seperate programs?
so that you do one, it outputs it, do another, output it so on so
forth. Can any one get me started on this please.


I see no advantage to one monolithic program, and no requirement to do so.
So I would opt for three programs. I would certainly get the input from a
file, in the long run there will be a lot less effort. Note the order is
jumbled, you want to sort before you do the binary search, not after.
Nov 28 '05 #4
Im not looking for someone to do the work for me, I just need to know
the thing s for starting arrays, how to do the differnt arrays and the
searchs, I dont know what the things John Harrison says, this is an
intro class and the 3rd project, the book is not specific of this stuff.

Nov 28 '05 #5

ho********@aim.com wrote:
Im not looking for someone to do the work for me, I just need to know
the thing s for starting arrays, how to do the differnt arrays and the
searchs, I dont know what the things John Harrison says, this is an
intro class and the 3rd project, the book is not specific of this stuff.


Tell your teacher you don't understand and ask for help.

Nov 28 '05 #6
ho********@aim.com wrote:
Im not looking for someone to do the work for me, I just need to know
the thing s for starting arrays, how to do the differnt arrays and the
searchs, I dont know what the things John Harrison says, this is an
intro class and the 3rd project, the book is not specific of this stuff.


You need three arrays, here's one of them

int main()
{
int array[10];
...
}

That's an array of ten integers. The other arrays are declared
similarly. If you honestly didn't know how to do that then the rest of
the exercise is going to be way beyond you. You need more help than you
can get from here, ask your teacher.

It's completely ridiculous for you to be expected to do linear search,
binary search and selction sort without having been told anything about
them already, so I would guess there is some misunderstanding somewhere.

john
Nov 28 '05 #7
<ho********@aim.com> wrote:
Im not looking for someone to do the work for me, I just need to know
the thing s for starting arrays, how to do the differnt arrays and the
searchs, I dont know what the things John Harrison says, this is an
intro class and the 3rd project, the book is not specific of this stuff.


There are degrees of knowing almost anything. But if you weren't just being
humble or shy and have no idea what the items in that list were about, you
need a tutor, someone you can talk to at length, at least on the telephone.
You can not expect the instructor to go back over all these things; or get
enough help via.a slow, serial, labor intensive medium such as Usenet.
Nov 28 '05 #8
John Harrison wrote:

It's completely ridiculous for you to be expected to do linear search,
binary search and selction sort without having been told anything about
them already, so I would guess there is some misunderstanding somewhere.


The original spec said that "Chapter 10" explained how to do
selection sort, so I guess it also explains binary search.

Nov 29 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Spamtrap | last post by:
I only do occasional Perl programming and most things I write are short processes. I have something I'm working on that is scanning a text file with about 15 million lines and trying to extract...
2
by: aj902 | last post by:
Hello , I am trying to create a program where all detail, http://www.albany.edu/~csi333/projects.htm
13
by: vgame64 | last post by:
Hi, I have been struggling with writing a program for a few hours. The requirements are that: """You will be writing a program which will determine whether a date is valid in terms of days in that...
4
by: robinsand | last post by:
My apologies to those of you who are more advanced Visual C++ .NET programmers, but I am working on a project for an MBA course that is condensed into an eight-week schedule, and I need help...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
8
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only...
4
by: naknak4 | last post by:
Introduction This assignment requires you to develop solutions to the given problem using several different approaches (which actually involves using three different STL containers). You will...
6
by: naknak | last post by:
Introduction This assignment requires you to develop solutions to the given problem using several different approaches (which actually involves using three different STL containers). You will...
1
by: peterggmss | last post by:
This is a slot machine game, 2 forms. One is the actual game (frmMachine) and the other is in the background and randomizes the images shown on frmMachine. I need to make frmMachine wait for...
1
by: raghavshastri | last post by:
You are to write a C++ program to perform a statistical analysis of the blobs in an image. The image will be a grayscale image in PGM format for simplicity. Here is a sample PGM image with 10...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.