Project #12510 - week 7 assignment

Instructions

When developing more difficult programs, it is important to take an incremental approach. Start by developing the simplest program and make small modifications to it until it evolves into the final result. Try to keep a functional program at all times.

First, write a simple program that will read 5 numbers from the Console (user input). Store these values into an array of int[ ]. Using the length of the array in a for() loop and decrementing the loop counter, write the array values in reverse order to the screen. This is step one and may be enough for partial credit. If you have difficulty with this, try seeking some assistance from your instructor before going on to step two.

Next, add code to read 5 words from the Console (user input). Store these values into an array of string[ ]. Make sure the string[ ] array is large enough to hold at least 6 values. Store the string constant “end_of_array” into the last element of the array. Using a do…while() loop, print out the 1st and 3rd letters of each word (two letters per line) using the substring function. This is step two and should ensure you at least a passing grade.

Finally, add to the program the following:

  • Read 5 numbers in from a text file (numbers.txt)
  • Write the values in reverse order to a second file
  • Read the words in from a third file, displaying the results to the Console. This is your completed project.

Note that you should not hard code the pathname “C:\\Projects\\Week7\\numbers.txt” to these files. If you leave the path off, the program will look for the file in the default directory (usually the same directory as the source file). This is how you should do this as your instructor will not have the same directory structure as you do. For example:

ifstream inData;
ofstream outData;
inData.open("numbers.txt");
outData.open("output.txt");

 

PLEASE NOTE:

window os

visual studio, C++

.zip file

Subject Computer
Due By (Pacific Time) 09/22/2013 12:00 am
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy