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
-------------------------------------------------------------
Here are the list of services provided by our program:
Enter D for deposit.
Enter C for check.
Enter W for withdrawal.
Enter Q for quitting the program (in which case all your information will be displayed).
-------------------------------------------------------------
Enter your choice (Q to quit the program):
D
You would like to deposit an amount of money.
Enter the amount:
2000
Enter your choice (Q to quit the program):
C
This is a service provided for checks.
Enter the amount of the check:
1000
Enter your choice (Q to quit the program):
W
You would like to withdraw an amount of money.
Enter the amount:
1500
Enter your choice (Q to quit the program):
D
You would like to deposit an amount of money.
Enter the amount:
3500
Enter your choice (Q to quit the program):
Q
You are to quit the program. Here is your final information.
------------------------------------------------------------------------
Opening Balance: 5000.
Total amount of deposits: 5500
Total amount of checks: 1000
Total amount of withdrawals: 1500
Final Balance: 8000
Bonus Question:
The perfect square of a number is defined as the sum of consecutive odd, positive integers starting at 1 (and ending at some odd index N). In other words, given any number, you should find the square of this number and find all odd numbers whose sum will make the square of the given number. Your task is to write a program that checks that this definition holds for a various values of numbers. Your program should work for more than one number. If the user enters -1, your program should come to end.
Sample Input/Output:
Enter a number, please (-1 to end the program):
4
The square of 4 (16) is a perfect square, because
1 + 3 + 5 + 7 = 4 * 4 = 16
Enter a number, please (-1 to end the program):
5
The square of 5 (25) is a perfect square, because:
1 + 3 + 5 + 7 + 9 = 5 * 5 = 25
Enter a number, please (-1 to end the program):
7
The square of 7 (49) is a perfect square, because:
1 + 3 + 5 + 7 + 9 + 11 + 13 = 7 * 7 = 49
Can u guys help me on these plz![]()