Write a program that prompt user to enter a positive integer


C++ Programming Assignment

Problem 1

Write a program that prompts the user to enter a positive integer. Use a loop to compute the sum of all integers between 1 and the number entered.

Problem 2

Write a program that computes the rise of ocean levels for the next x years where x is an integer larger than 2 entered by the user. Use #include to properly align the output match the formatting in the example below.

Problem 3

Write a program that simulates a checking account. Initially, the program prompts the user to open an account and deposit an initial balance of at least $20. Afterwards, the program repeatedly shows a menu with the following options:

1. Depositing money
2. Withdrawing money
3. Viewing the current balance
0. Exit

Split your program using functions. Define the following prototypes and implement them below the main:

// shows menu, prompts for and returns valid option int promptOption();
// prompts for amount (>0) to deposit and adds it to the balance void deposit(float &balance);
// prompts for amount (>0) to withdraw and
// subtracts it from the balance void withdraw(float &balance);

Format your assignment according to the following formatting requirements:

1. The answer should be typed, double spaced, using Times New Roman font (size 12), with one-inch margins on all sides.

2. The response also include a cover page containing the title of the assignment, the student's name, the course title, and the date. The cover page is not included in the required page length.

3. Also Include a reference page. The Citations and references should follow APA format. The reference page is not included in the required page length.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a program that prompt user to enter a positive integer
Reference No:- TGS02961745

Now Priced at $40 (50% Discount)

Recommended (93%)

Rated (4.5/5)

2015 ┬ęTutorsGlobe All rights reserved. TutorsGlobe Rated 4.8/5 based on 34139 reviews.