start
Call a method to get the interest.
Output the interest to the user.
stop
Write a method with a return type that inputs the principal from the user, calculates the interest and returns the value of the calculated interest.
//function to accept principal amount as argument and return the
interest
double calculator(double principal)
{
double rate=9.2;//assign the
interest rate
double annualInterest; //declare
annualInterest
annualInterest = (principal *
rate)/100; //compute the interest amount
return annualInterest;//return the
annual interest
}
start Call a method to get the interest. Output the interest to the user. stop Write...
Create the Pseudocode logic for a program that helps a user to calculate one year of simple interest. Create an appropriately named method to: input the amount the user is investing (principal) calculate one year of interest at a rate of 7% (the formula is quite simple, interest is the amount invested times 0.07) output the interest Be aware that any variables required by the method must be declared in the body of the method, not after immediately start like...
ACTUE 142 Read multiple user inputs Write two statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash, and the year. End with newline The program will be tested with inputs 1 2000, and then with inputs 5 1950. Ex If the input is 1 2000, the output is 1/2000 4 int main) ( 5 int birthMonth; 6 int birthYear 8 cino>birthMonth; 10 return ; Run
Program#3(17 points): write a java program (SunDigits) as follows The main method prompts the user to enter an integer number. The method then calls Method Sum (defined blew) to add the digits and return their total. The main method then prints the digits total with proper label as shown below Method Sum )is of type integer and takes an integer value. The method recursively adds up the digits and returns their total. Document your code and use proper prompts for...
Write a Python program that asks the user to type in their three quiz scores (scores between 0 and 100) and displays two averages. The program should be written so one function gets the user to input a score, another function takes the three scores and returns the average of them. And another function takes the three scores and averages the two highest scores (in other words, drops the lowest). Each of these functions should do the computation and return...
Can I please get help to write a code in C# that allows the user to enter an address and returns this as an output This will need to be a seperate class that is going to pass it to a method contained in another console application. For example, this method will be called in another console application by: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Address; where Address is the title of the other class...
Program62 Write a class that has a main method and two more methods for performing calculations on a circle. One void method calculates and prints the circumference of the circle and the other method returns the area of the circle. The main method should prompt the user to enter the diameter of the circle (as a double) and call the other methods with this input as an argument. Both the circumference and area should be displayed accurate to three decimal...
A class Scanner in Java can be used to get user input and its methods can be used after the following statement is executed: Scanner input = new Scanner(System.in); One of its methods nextDouble() returns the next double value from the keyboard. Now you are requested to write a method enterHeight() which displays the message "Input height: " and uses the method input.nextDouble() to get the user input. The process should be repeated until the input is non-negative. Finally the...
1 – Write a subroutine that reads a word from the user. The subroutine gets the input from the keyboard and returns as output a string containing all the characters the user typed until either a space character is found or there are no more characters in the keyboard buffer. For example: If the user types the following input: Welcome to Disney World The first call to the subroutine should return “Welcome” The second time the subroutine is called, it returns...
(a) A class Scanner in Java can be used to get user input and its methods can be used after the following statement is executed: Scanner input = new Scanner(System.in); One of its methods nextDouble() returns the next double value from the keyboard. Now you are requested to write a method enterHeight() which displays the message "Input height: " and uses the method input.nextDouble() to get the user input. The process should be repeated until the input is non-negative. Finally...
Write a Python program: In main function the user is asked to enter distance traveled and time and then send this information to a Python function that calculates and returns the speed of a car. The function will need to have parameters for distance traveled and time taken for the travel. The speed is calculated as: Speed = distance traveled / time In the main function show how to call this function in a print statement.