473,320 Members | 1,953 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,320 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 1572
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.