Question

In: Computer Science

a.Create the logic for a program using pseudocode that calculates and displays the amount of money...

a.Create the logic for a program using pseudocode that calculates and displays the amount of money you would have if you invested $5000 at 2 percent simple interest for one year. Create a separate method to do the calculation and return the result to be displayed.

b.Modify the program in Exercise 2a so that the main program prompts the user for the amount of money and passes it to the interest-calculating method.

c.Modify the program in Exercise 2b so that the main program also prompts the user for the interest rate and passes both the amount of money and the interest rate to the interest-calculating method.

Solutions

Expert Solution

Please give a Thumps up if you like the answer.

a.

Start
   Declarations
       num balance
       num PRINCIPAL = 5000
       num INTEREST_RATE = 2
   balance = calculateBalance(PRINCIPAL,INTEREST_RATE)
   output "After one year the balance is $", balance
Stop

num calculateBalance(num PRINCIPAL,num INTEREST_RATE)
   Declarations
       num balance
   balance = PRINCIPAL * (1 + INTEREST_RATE/100)
   return balance

b.


Start
   Declarations
       num balance
       num PRINCIPAL
       num INTEREST_RATE = 2
   output "Please enter principal amount : $"
   input PRINCIPAL
   balance = calculateBalance(PRINCIPAL,INTEREST_RATE)
   output "After one year the balance is $", balance
Stop

num calculateBalance(num PRINCIPAL,num INTEREST_RATE)
   Declarations
       num balance
   balance = PRINCIPAL * (1 + INTEREST_RATE/100)
   return balance

c.

Start
   Declarations
       num balance
       num PRINCIPAL
       num INTEREST_RATE
   output "Please enter principal amount : $"
   input PRINCIPAL
   output "Please enter interest rate : %"
   input INTEREST_RATE
   balance = calculateBalance(PRINCIPAL,INTEREST_RATE)
   output "After one year the balance is $", balance
Stop

num calculateBalance(num PRINCIPAL,num INTEREST_RATE)
   Declarations
       num balance
   balance = PRINCIPAL * (1 + INTEREST_RATE/100)
   return balance


Related Solutions

make a c++ program that calculates the amount left from a value of money of one...
make a c++ program that calculates the amount left from a value of money of one dollar bill or less in quarters, dimes, nickels, and pennies. The remaining value can be shown in cents knowing that in cents: penny = 1 nickel = 5 dime = 10 quarter = 25
Design a c++ program that calculates the amount of money a person would earn over a...
Design a c++ program that calculates the amount of money a person would earn over a period of time if his salary is one penny the first day, two pennies second day, and continues to double each day. The program should ask the user for the number of days. Display a table showing what the salary was for each day, and then show total pay at the end of the period. the output should be displayed in a dollar amount,...
Create an application that calculates and displays the amount of a homeowner’s property tax. The tax...
Create an application that calculates and displays the amount of a homeowner’s property tax. The tax is 1.35% of the property’s assessed value, which will be entered by the user. a. Prepare a Planning Chart for the application. b. Draw a sketch of an appropriate interface. Be sure to follow the GUI design guidelines covered in the chapter. The guidelines are summarized in Figure 2-20. (If you want to include an image in the interface, you can either use your...
Please use Phyton to write a program: Write a program that calculates and displays the total...
Please use Phyton to write a program: Write a program that calculates and displays the total bill at a restaurant for a couple that is dining. The program should collect from the couple, cost of each meal, and the percentage of the final cost that they would like to tip. The sales tax in the state where the restaurant exists is 7.5%. Display to the user, line by line: Total Cost of Both Meals Sales Tax in dollars Tip in...
Create the pseudocode solution to a program that calculates the final score and letter grade for...
Create the pseudocode solution to a program that calculates the final score and letter grade for one student. Please use the following grading system: 9 Homework Assignments – 100 points each 10 points 11 Quizzes – 100 points each 5 points 5 Projects – 100 points each 10 points 6 Discussion posts – 100 points each 10 points 4 Exams – 100 points each 65 points A = 90 – 100% B = 80 – 89% C = 70 –...
Write a program named MakeChange that calculates and displays the conversion of an entered number of...
Write a program named MakeChange that calculates and displays the conversion of an entered number of dollars into currency denominations—twenties, tens, fives, and ones. For example, if 113 dollars is entered, the output would be twenties: 5 tens: 1 fives: 0 ones: 3. Answer in C# (P.S i'm posting the incomplete code that i have so far below.) using System; using static System.Console; class MakeChange { static void Main() { int twenties, tens, fives, ones; WriteLine("Enter the number of dollars:");...
Design the logic for a program that allows a user to enter 20 numbers, then displays...
Design the logic for a program that allows a user to enter 20 numbers, then displays them in the reverse order of entry. Design the logic for a program that allows a user to enter 20 numbers, then displays each number and its difference from the numeric average of the numbers entered. The program is C++. I need a Pseudocode
Write pseudocode algorithms for the programs described as follows:- Available Credits A program that calculates a...
Write pseudocode algorithms for the programs described as follows:- Available Credits A program that calculates a customer’s available credit should as the user for the following:  The customers maximum amount of credit  The amount of credit used by the customer Once these items have been entered, the program should calculate and display the customer’s available credit. You can calculate available credit by subtracting the amount of the credit used from the maximum amount of credit. (I need this...
DESIGH A FLOWCHART IN FLOWGORITHM Speeding Violation Calculator. Design a program that calculates and displays the...
DESIGH A FLOWCHART IN FLOWGORITHM Speeding Violation Calculator. Design a program that calculates and displays the number of miles per hour over the speed limit that a speeding driver was doing. The program should ask for the speed limit and the driver's speed. Validate the input as follows: The speed limit should be at least 20, but not greater than 70. The driver's speed should be at least the value entered for the speed limit (otherwise the driver was not...
ITP100 Project: Part 3 Create the pseudocode solution to a program that calculates the final score...
ITP100 Project: Part 3 Create the pseudocode solution to a program that calculates the final score and letter grade for one student. Please use the following grading system: 9 Homework Assignments – 100 points each 10 points 11 Quizzes – 100 points each 5 points 5 Projects – 100 points each 10 points 6 Discussion posts – 100 points each 10 points 4 Exams – 100 points each 65 points A = 90 – 100% B = 80 – 89%...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT