Create a text file with the users name and store everything

Assignment Help Computer Engineering
Reference no: EM132207496

Write a program which:

1. Asks the user to enter his/her name AND validates it

2. Once the name is validated, then the program prompts the user to enter anything (s)he wants until user types -1.

3. The program must create a text file with the user's name AND store EVERYTHING the user types in it.

4. The program must then read the contents of the file and count the number of even digits and the number of odd digits

5. The program should display the number of even digits if there are any; otherwise it should indicate that there are no even digits.

6. The program should display the number of odd digits if there are any; otherwise it should indicate that there are no odd digits.

7. The program MUST have the following functions:

void validateUserName(which parameters? pass by reference or by value?);//validate user name

void validateUserInput(which parameters? pass by reference or by value?);//validate user input

void checkEvenDigit(which parameters? pass by reference or by value?);//check for the presence of even digits

void checkOddDigit(which parameters? pass by reference or by value?);//check for the presence of odd digits

void createFile(which parameters? pass by reference or by value?);//create userFile

void writeDataToFile(which parameters? pass by reference or by value?);//write to the file

void readDataFromFile(which parameters? pass by reference or by value?);//read from the file

void displayResults(which parameters? pass by reference or by value?);//display results

8. The main() function should consist mostly of local variable declarations and a series of function calls. One of the objectives of the quiz is to get you to "modularize" your programs using functions-hence main() must necessarily be very short!

GENERAL RESTRICTIONS FOR ALL ASSIGNMENTS

No global variables

No infinite loops, examples include:

for(;;;)

while(1)

while(true)

do{//code}while(1);

No break statements to exit loops

Reference no: EM132207496

Questions Cloud

Calculate the natural rate of unemployment : Calculate the natural rate of unemployment for this example. Now assume that pet = ?pt-1 and suppose ? is initially equal to 0. Suppose that the rate.
Golden girl of metropolitan government : Krista Acklen was the “golden girl” of a metropolitan government in a large midwestern city.
Calculate the average of the first ten terms sequence : Write a piece of code that calculates the average of the first 10 terms sequence using a for loop, and then prints the resulting average.
What is the purpose of establishing pay ranges : What is the purpose of establishing pay ranges? Be sure to write response in third person narrative.
Create a text file with the users name and store everything : The program must create a text file with the user's name AND store EVERYTHING the user types in it.
What is the cost to consumers of steel : If the labor input is 2 person hours per finished ton of steel, what is the cost to consumers of steel per domestic steel industry job saved by the tariffs?
Incorporated into the final divorce degree : When Roger and Susan divorced, they entered into a property settlement agreement that was incorporated into the final divorce degree.
Elements of keurig external and internal environments : How does Keurig’s strategy stand up against competitive rivalry in the industry? Review the important elements of Keurig’s external and internal environments.
How did each painting reflect or inspire social change : How did each painting reflect or inspire social change or revolution? What was the social or revolutionary context of the painting?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Could it use the same stack as the application program

When an operating system receives a system call from a program, a switch to the operating system code occurs with the help of the hardware.

  Define next state function in terms of description

Define next state function in terms of description and as a state transition diagram or a mathematical function or pseudo code.

  What is required to de ne a well-posed learning problem

What is required to de ne a well-posed learning problem - Here are two potential real-world application tasks for machine learning

  Why the requirements of the levels limit the type of product

Indicate why the requirements of these levels limit the type and complexity of products that can be evaluated to them.

  Define what is a time you failed at solving a problem

What is an example of a time you succeeded at solving a problem. What is a time you failed at solving a problem

  Design a software solution to a problem in your life

Using tools and concepts learned this week to design a software solution to a problem in your life.

  The most important roles in systems development

How have the roles of systems analysts and end users changed in the past 20 years? What are the benefits and drawbacks to these changes.

  Implement the hypercube bitonic sort algorithm

Write an MPI program that implements the hypercube bitonic sort algorithm.

  Write a program that takes its input from a binary file

The number a is the average of the numbers n1, n2, n3, and so forth. Hint: Write your program so that it first reads the entire file and computes the average of all the numbers, then closes the file, and then reopens the file and computes the stan..

  What signal encoding cables and connectors are used

What signal encoding, cables, and connectors are used? Is the channel serial or parallel? Is transmission synchronous or asynchronous?

  What are the latest ways to steal identity and money

What are the latest ways to steal identity and money? Social Security numbers are the most valuable pieces of consumer information for identity thieves! How can we prepare and protect ourselves?

  Using recursion determine the number of tribble for any hour

Write a JAVA program that uses recursion to determine the number of tribble for any hour.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd