Plz help itz due 2day

D

Dark_AngeL

Guest
Hi i have 2 submit this 2day @ 4 plz help me ;(


Question 1:

Write a program that reads in two integers from the user. The program should then calculate the sum of all even integers and the product of all odd integers between them exclusive (the two boundary numbers must not be included).

Sample Input/Output:

Enter two integers, please:
10 20

The even integers between 10 and 20 are:
12 14 16 18, and their sum is: 60

The odd integers between 10 and 20 are:
11 13 15 17 19, and their product is: 692835

------------------------------
Question2:

After many years of being frustrated by a checkbook that just will not balance, you decide to write a program to help balance your money market checking account. The program should begin by asking the user for the month's opening account balance. Then the program should display a menu that lists the following choices: D for a deposit, C for a check, W for a withdrawal, and Q for quit. If the user selects D, ask the user to enter the amount of the deposit, and add the amount to the account balance. If the user enters C, ask the user for the amount of the check, and subtract the check amount form the balance. If the user enters W, ask the user for the amount of the withdrawal, and subtract the amount from the balance. When the user enters Q, the program should display the opening balance, the total amount deposited, the total amount withdrawn, the total amount of the checks, and the final balance. If the user enters something other than D, W, C, or Q, the program should issue an error message and redisplay the menu. Allow the user to enter either upper - or lowercase letters.

Sample Input/Output:

Enter your opening account:
5000

:rolleyes:
 
Dark_AngeL said:
Hi i have 2 submit this 2day @ 4 plz help me ;(


Question 1:
...
------------------------------
Question2:
...
:rolleyes:

So what language and class is this supposed to be for?

In the first case, take a look at the MOD function in the language you're using, you should be able to simply do a for loop (for x=[startval + 1 ] to [endval + 1]) check to see if the current number is divisible by two and take it from there.

The second one sounds like a simple menu system with a select case statement based on the user's menu selection.
 
Back
Top