d2jsp
d2jsp Forums > Programmer's Haven > C/C++/C# > C Projects - Offering Fg > Iso Help
Add Reply New Topic New Poll
Genniv
#1 Mar 14 2018 02:50pm
Group: Member
Posts: 5,573
Joined: May 3 2010
Gold: 196.00
The first few programs in this class were fairly simple to wrap my head around, but the last 2 just seemed to launch right into the deep end, and I am lost.
So, in hopes of salvaging my GPA, I'd appreciate some help in putting together this one program using two arrays and a header file. If interested in helping, PM me or post in here, I can provide
full program details/requirements.

Thank you.
YCX
#2 Mar 14 2018 07:19pm
Group: Member
Posts: 108
Joined: Jan 24 2009
Gold: 2,373.85
i'm interested
Adpist
#3 Mar 15 2018 01:17am
Group: Member
Posts: 1,056
Joined: Mar 7 2018
Gold: 8,083.00
Post program specs
Genniv
#4 Mar 15 2018 09:50am
Group: Member
Posts: 5,573
Joined: May 3 2010
Gold: 196.00
Write a program to manipulate data in an array

Should begin with the prompt:

"DATA CONFIRMATION AND UPDATE PROGRAM WRITTEN IN C"

"Program written by XXXXXX."
"Program compiled on XXXX at XXXX."

"Here is what data set 1 looks like now:"
[ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ]
4 7 6 32 5

"Here is what data set 1 looks like now:"
[ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ]
98 47 26 99 187

"which data set do you want to work with [ 1 or 2 ]:"


Create the two arrays in a new header file and initialize them to the values shown.
Make the arrays to hold the data 20 elements long, using a symbolic constant to set that value.

After the user selects one of the data sets to work with, allow them to keep interacting with that
data set until they indicate they want to change it.

Offer the user the following menu

"DATA CONFIRMATION AND UPDATE PROGRAM"
1. Display data set now.
2. Delete an entry from the data set.
3. Add an entry to the end of the data set.
4. Change an existing entry.
5. Quit this program.
"Enter choice [ 1-5, 0 = change data set]:"


Each of these should be done in its own function. Cohesiveness counts!

For the display data set, use the same function you wrote that displays it when the program
begins.

For deleting an entry, prompt the user with

"Which entry do you want to delete [ 1-5, 0=return to Menu ]:"

and allow them to enter a 1, 2, 3, 4, or 5, or a zero, which will do nothing and return to the main
menu. After you remove the element, move the remaining elements over to fill in the hole. For
example,

"Here is what data set 1 looks like now:"
[ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ]
4 7 6 32 5


"Which entry do you want to delete [ 1-5, 0=return to menu ]: 3
Deleting entry 3."

"Here is what data set 1 looks like now:"
[ 1 ] [ 2 ] [ 3 ] [ 4 ]
4 7 32 5


Note that when we display the elements, we start with entry 1, not zero. Internally, of course, you
need to be aware that our arrays always start with element 0.


Adding an entry will just put a value at the end of the list.

Changing an existing entry will allow the user to directly modify a value that's already there.

"Here is what data set 1 looks like now:"
[ 1 ] [ 2 ] [ 3 ] [ 4 ]
4 7 32 5


"Which entry do you want to change [ 1-4, 0=return to menu ]: 3
Existing entry 3 has the value 32."

"New Value: 94"

"Entry 3 now has the value 94."
"Here is what data set 1 looks like now:"
[ 1 ] [ 2 ] [ 3 ] [ 4 ]
4 7 94 5








***I tried to format it so the prompt displayed by the program appears in quotes and the lab text itself falls respectively inbetween each section***

I have one header file already that I can use to display the programmer, date and time portion.
Let me know if I can clarify further.

This post was edited by JabbyG on Mar 15 2018 09:52am
bipolargod
#5 Mar 15 2018 10:39am
Group: Member
Posts: 25,346
Joined: Mar 26 2007
Gold: 5.95
Warn: 10%
"Program written by XXXXXX."

Insert d2jsp coders nickname here
Adpist
#6 Mar 15 2018 11:51am
Group: Member
Posts: 1,056
Joined: Mar 7 2018
Gold: 8,083.00
What kind of help do you expect ? Full program code source ? Extra explanations and follow up to understand it ? Or only support for programming it ?

If you really want to learn coding, you need to understand it.

If you want i can help you to put it up in this thread. I won't say no if you give me some fg for it, since i'm new and a bit short of it :)

Please edit your specs post and add your header and main file to check what you are using so far. Been a long time since i coded in C ;)

This post was edited by Adpist on Mar 15 2018 12:05pm
YCX
#7 Mar 15 2018 12:57pm
Group: Member
Posts: 108
Joined: Jan 24 2009
Gold: 2,373.85
i sent you some code. let me know if you have questions
xapeu
#8 Mar 24 2018 05:14pm
Group: Member
Posts: 11,065
Joined: Apr 26 2008
Gold: 3,576.50
lmk if still need help
Cocoo
#9 Apr 26 2018 02:57pm
Group: Member
Posts: 20,580
Joined: Aug 3 2011
Gold: 6,560.00
Warn: 10%
Quote (bipolargod @ Mar 15 2018 09:39am)
"Program written by XXXXXX."

Insert d2jsp coders nickname here


:rofl:
Go Back To C/C++/C# Topic List
Add Reply New Topic New Poll