Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | May 2017 |
Last Sign in: | 308 Weeks Ago |
Questions Answered: | 66690 |
Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Task #1: Counter controlled loop
a). Write a program that will use a counter-controlled loop to display the first 50 numbers
b). Modify the program to prompt the user for a number. Starting with that number, use the counter controlled loop to display 50 numbers beginning with the number the user keyed in.
Task #2: Sentinel Controlled loop
Sentinel controlled loop with numbers
Modify the program to prompt the user to input a list of numbers. Display the number enter to the user .To end entering the list in the input the user must enter -1 as the sentinel value that will terminate the loop.
Sentinel controlled loop with strings
Modify the program to prompt the user to input a list of names. Display the name enter to the user .To end entering the list in the input the user must enter an * as the sentinel value that will terminate the loop.
Task #3: EOF controlled loop
Modify the program in task #1 to write on the first 50 numbers to a file name numbers.txt. Afterwards, open the file as an input-file and use the EOF to control your loop.Display the records read from the file to the screen.After the EOF returns the value of true, the loop will terminate
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll