1- If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of 4.5% of the money; otherwise, the interest rate is 3.0% of the money. Write a program to accept the number of years in the variable numYears and money in the variable money then display the correct interest rate, depending on the value input into numYears

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
1- If money is left in a particular bank for more than 5 years, the bank pays
interest at a rate of 4.5% of the money; otherwise, the interest rate is 3.0% of
the money. Write a program to accept the number of years in the variable
numYears and money in the variable money then display the correct interest
rate, depending on the value input into numYears
2- Write a program that accepts a user-entered number and calculates the square.
Before calculating, check that the number is negative, and isn't zero. If either
condition occurs, display a message stating that the operation can't be
calculated.
3- Write a program which accept a number of 2 digits and check if ones digit is
greater than the tens digit print the number in reverse order, if each of the ones
digit and the tens digit greater than 5 print the average of them (ones and tens),
otherwise print the message( NOT valid ).
4- Write C++ program to accept a number num (with any number of digits).
Then, if the number of digits equal to 3, the program reverse the number num
and then print num. Otherwise, the program print the number num without
reverse. (10 Marks)
Example:
If thenum is 523
If thenum is 34
If the num is 3259
the num print by the program is 325
the num print by the program is 34
the num print by the program is 3259
5- Write a program which read a number consists of 4 digits and find the
maximum digit of the number.
FOR eg.
the maximum digit is 7
the maximum digit is 9
6- Write a program to input number of 3 digits and check any digit is even
convert it to 3 and any digit is odd convert it to 4.
1472
9835
FOR eg.
127 after check 434
359 after check 444
684 after check 333
Transcribed Image Text:1- If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of 4.5% of the money; otherwise, the interest rate is 3.0% of the money. Write a program to accept the number of years in the variable numYears and money in the variable money then display the correct interest rate, depending on the value input into numYears 2- Write a program that accepts a user-entered number and calculates the square. Before calculating, check that the number is negative, and isn't zero. If either condition occurs, display a message stating that the operation can't be calculated. 3- Write a program which accept a number of 2 digits and check if ones digit is greater than the tens digit print the number in reverse order, if each of the ones digit and the tens digit greater than 5 print the average of them (ones and tens), otherwise print the message( NOT valid ). 4- Write C++ program to accept a number num (with any number of digits). Then, if the number of digits equal to 3, the program reverse the number num and then print num. Otherwise, the program print the number num without reverse. (10 Marks) Example: If thenum is 523 If thenum is 34 If the num is 3259 the num print by the program is 325 the num print by the program is 34 the num print by the program is 3259 5- Write a program which read a number consists of 4 digits and find the maximum digit of the number. FOR eg. the maximum digit is 7 the maximum digit is 9 6- Write a program to input number of 3 digits and check any digit is even convert it to 3 and any digit is odd convert it to 4. 1472 9835 FOR eg. 127 after check 434 359 after check 444 684 after check 333
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY