Write a program that shows the growth of money that occurs in a savings account. Your program should read in the initial balance, should use 6.0 percent as the annual interest rate. Interest is compounded monthly. Your program should print out the balance for the first three months. For example: Initial balance: 1000 After first month: 1005.0 After second month: 1010.025 After third month: 1015.075125
Q: Write a program that takes the user age and prints the following: Print too old, if age is greater…
A: Use if else if statements to check all the conditions one by one
Q: Write a program that prints all numbers between 1 and 100 that are divisible by both 5 and 7.
A: for num in range(1,100): if num%5==0 and num%7==0: print(num)
Q: Write a program that accepts a number of minutes and converts it both to hours and days. For…
A: As no programming language is mentioned it is solved using basic C++
Q: Write a program that will compute for the salesman's commission based from his total sales for the…
A: As no programming language is mentioned, it is solved using basic C++
Q: Write a program using if, and elif and else, that asks the user what their favorite food is. Then…
A: We need to read a string and compare the string with list of favorite food.
Q: Write a program that asks the user for a word, then prints out the word between the word bread, to…
A: Please find the answer below :
Q: Write a program that reads the price and the production date(month and year of an item) then prints…
A: import java.util.*;import java.io.*; public class Main{ public static void main(String[] args)throws…
Q: Write a program that will check and print if the person is a regular passenger, student or senior…
A: Program Code: #include<stdio.h>#include<conio.h>main(){ int ch,fare; printf("If you are…
Q: Write a program that reads a bank aCcount balance and an interest rate and displays the value of the…
A:
Q: Write a program to find the equivalent series and parallel resistance for 3 resistor values. Your…
A: As there is no programming language mentioned in question . program is attempted in c language user…
Q: Write a program that reads a word and prints whether it is short (fewer than 5 letters). • it is…
A: #include<iostream> #include<iomanip> #include<string> using namespace std; int…
Q: Write a program that asks the user for a number of seconds and prints out how many minutes and…
A: Program: To asks the user for a number of seconds and print as minutes and seconds format.…
Q: Write a program with total change amount in pennies as an integer input, and output the change using…
A: A required Java program is as follows, File name: “LabProgram.java” import java.util.Scanner; public…
Q: Write a program that accepts a year written as a four-digit Arabic (ordinary) numeral and outputs…
A: Code in C++: #include<iostream>using namespace std;int main(){ //declaring required…
Q: ncreme
A: The program provided below calculates flame theoretical temperature when a mixture of methane,…
Q: Write a program using if, and elif and else, that asks the user what their favorite food is. Then…
A: According to the information given:- We have to create the program in that we as user to tell his…
Q: Write a program that computes the rent in five years and the total rent for one year starting five…
A: Program description: Assume, b be a user input integer variable that stores the basic salary. r is a…
Q: ask3.c 4. Task 3: Using a.. 1 Your code goes here... Collapse 4. Task 3: Using a nested loop Write a…
A: Since you are not specify any language for implementation I am doing in C language. Program…
Q: Write a program that reads the following information and prints a payroll statement: Employee’s name…
A: Answer:
Q: Write a program that calculates the amount of money a person would earn over a period of time if his…
A: here in given question ask for python program.
Q: Write a program that converts a given number of minutes into hours:minutes:seconds format. For…
A: C++ Program for above : #include <iostream> #include <iomanip> using namespace std;…
Q: Write a program that asks the user the number of hours an employee worked and his hourly wage,…
A: #include <iostream>using namespace std; int main() { int hours=0,wage=0; double…
Q: Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D,…
A: Program that translates a letter grade into a number grade. Algorithm: Start Input a letter…
Q: Write a program that will determine how many coins of each denomination (50kr, 25kr, 10kr, Skr, and…
A: I'm using C++ to code following given question:
Q: Write a program that simulates a snail trying to crawl up a building of height 6 steps. The snail…
A: Actually, given information. Write a program that simulates a snail trying to crawl up a building of…
Q: Write a program with total change amount in pennies as an integer input, and output the change using…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner…
Q: а. Write a program that calculates and prints the fare for an airline. There are two plans: Plan…
A: Code: #include <cctype> #include <iostream> #include <cstring> #include…
Q: Write a program that prints the day number of the year, given the date in the form month-day-year.…
A: Programming Approach Declare a header file. Using namespace. Define function prototypes Declare a…
Q: Write a program that prints the day number of the year, given the date is in the form month day…
A: "because of our policy, we can solve one question at a time if you need the rest of the solution…
Q: Write a program that can suggest an activity based on the temperature. If the temperature is between…
A: Hi. As you have not mentioned any programming language, I will choose Python. Let's move on to…
Q: Write a program that interprets the Body Mass Index (BMI) based on a user's weight and height. It…
A: Python code to find BMI of person is given below.
Q: Write a program that prints a grocery receipt of items purchased.
A: The Given program is to print a grocery receipt
Q: Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D,…
A: Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D,…
Q: Write a program that reads a person's first and last names, separated by a space. Then the program…
A: The program will read entered name and stores into a variable. using the split method, it splitas…
Q: Write a program that reads the length and width of a rectangle as integers from the keyboard and…
A: Given: We are given a program that reads input as length and width of a rectangle as integers.…
Q: Write a program that asks the user how many credit units they have taken. If they have taken 23 or…
A: Program Approach: Include the necessary header files for the standard I/O. Declare a user input…
Q: write a program that prints all multiples of 5 between 5 and 50 inclusive and then reads a number…
A: Since you have not mentioned any specific programming language, we will solve this question for you…
Q: Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For…
A: PROGRAM: //header files #include <iostream> #include<iomanip> //using namespace using…
Q: Write a program that takes in a string that holds the values "day" or "night" and an integer that…
A: C++ is a programming language. Nested if loop is used to check condition under some condition.
Q: Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D,…
A: Please find the answer below :
Q: Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D,…
A: ANS: I had written the code in C language: #include <stdio.h> int main(){ float a;…
Q: Write a program that reads an integer age of kids, finds the maximum of them, and counts its…
A: #include <iostream> using namespace std; int main(){ int…
Q: Write a program that reads the price and the production date(month and year of an item) then prints…
A: % read price and production price = input('Enter price'); production_month = input('Enter production…
Q: Write a program that prompts the capacity, in gallons, of an automobile fuel tank and the miles per…
A: Note: In this question the coding language is not specified then we are doing this question in the…
Q: Write a program that reads a number in feet, converts it to meters, and displays the result. One…
A: PROGRAM CODE: import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: . Write a program that computes the theoretical flame temperature when a mixture of methane,…
A: This program provided below calculates flame theoretical temperature when a mixture of methane,…
Q: Write a program that computes the cost of postage on a first-class letter according to the following…
A: Use an if-else block to find the cost of postage and then another if-else block to check for special…
Q: Write a program that calculates the cost per square inch of a circular pizza,given its diameter and…
A: We need to find the per square inch of any circular pizza where diameter and price of pizza will be…
Q: Write a program that will read a number and will display the factors of the number. Factors are…
A: Program code: x=int(input("Enter a number: "))print("The factors of",x,"are:")for i in range(1, x +…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient the following data should be entered: • The number of days spent in the hospital• The daily rate• Charges for hospital services (lab tests, etc.)• Hospital medication charges.If the patient was an out-patient the following data should be entered:• Charges for hospital services (lab tests, etc.)• Hospital medication charges.Use a single, separate function to validate that no input is less than zero. If it is, it should be re-entered before being returned.Once the required data has been input and validated, the program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out- patient data. Both functions should return the total charges.A supermarket is doing a sales promotion for soft drinks. If one day you buy soft drinks and bring the empty bottles the next day, they exchange each set of K empty bottles for a full one. A customer wants to make the most of this offer and therefore bought several bottles on the first day of the promotion. Now he wants to know how many bottles he will have at the end of the second day of the promotion if he use it to the fullest. Make a program to calculate this. Input The first input line contains integer T (1 ≤ T ≤ 10000), which indicates the number of test cases. In each of the following T lines come two integers N and K (1 ≤ K, N ≤ 10000), respectively the number of soft drinks bought and the number of empty bottles to gain a full. Output For each test case print the number of bottles that the customer will have on the second day, if he makes the most of the offer.Write program that can be used by a small theater to sell tickets for performances. The theater's auditorium has 15 rows of seats, with 30 seats in each row. The program should display a screen that shows which seats are available and which are taken. For example, the following screen shows a chart depicting each seat in the theater. Seats that are taken are represented by an * symbol, and seats that are available are represented by a # symbol: Seats 123456789012345678901234567890 Row 1 ***###***###*########*****#### Row 2 ####*************####*******## Row 3 **###**********########****### Row 4 **######**************##****** Row 5 ********#####*********######## Row 6 ##############************#### Row 7 #######************########### Row 8 ************##****############ Row 9 #########*****############**** Row 10 #####*************############ Row 11 #**********#################** Row 12 #############********########* Row 13 ###***********########**###### Row 14…
- Write a program that reads the amount of a monthly mortgage payment andthe amount still owed—the outstanding balance—and then displays theamount of the payment that goes to interest and the amount that goes toprincipal (i.e., the amount that goes to reducing the debt). Assume that theannual interest rate is 7.49 percent. Use a named constant for the interest rate.Note that payments are made monthly, so the interest is only one twelfth ofthe annual interest of 7.49 percent.A parking garage charges a $2.00 minimum fee to park for up to three hours andan additional $0.50 per hour for each hour or part thereof over three hours. Themaximum charge for any given 24-hour period is $10.00. Assume that no car parksfor longer than 24 hours at a time. Write a program that will calculate and print theparking charges for each of three customers who parked their cars in this garageyesterday. You should enter the hours parked for each customer. Your programshould print the results in the below format, and should calculate and print thetotal of yesterday's receipts. The program should use the functioncalculateCharges to determine the charge for each customer.The Research team led by Bernadette Wolowitz at Cal-tech University has discovered a new Amoeba that grows in the order of a Fibonacci series every month. They are exhibiting this amoeba in a national. conference. They want to know the size of the amoeba at a particular time instant. If a particular month's index is given, write a program to display the amoeba's size. For Example, the size of the amoeba on month 1, 2, 3, 4, 5, 6,... will be 0, 1, 1, 2, 3, 5, 8.... respectively.
- write a program that displays, in ascending order,the first names of those students who have attended more than one day of the course.If there are students with the same first name, display their first and last names.Write a program that will calculate and print out bills for the city water company. The water rates vary depending on whether the water is for home use, commercial use or industrial use. A code of H means home use, a code of c means commercial use and a code of I means industrial use. The water rates are computed as follows: code H: P250.00 plus P0.002 per gallon used code c: P5,000.00 for the first 4 million gallons and P0.002 for each additional gallon. code I: P8,000 if usage does not exceed 4 million gallons, P14,000 if usage is more than 4 million gallons but not more that 10 million gallons and P18000 if usage exceeds 10 million gallons. Your program should prompt the user for the code and the gallons of water used. Your program should echo your input data and should print the amount due from the user. Your program should use a switch statement for the code (char data type). Use the float data…Write a program that computes and displays the charges for a patient's hospital stay. First, the program should ask if the patient was admitted as an inpatient or an outpatient. If the patient was an inpatient, the following data should be entered: • The number of days spent in the hospital • The daily rate Hospital medication charges • Charges for hospital services (lab tests, etc.) The program should ask for the following data if the patient was an outpatient: • Charges for hospital services (lab tests, etc.) • Hospital medication charges The program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the inpatient data, while the other function accepts arguments for outpatient information. Both functions should return the total charges and display it for the user. After the total charges have been calculated and displayed, write the result to a file, PatientReport.txt. You can use the techniques you learned in Chapter…
- A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write a program that calculates and prints the parking charges for each of three customers who parked their cars in this garage yesterday. You should enter the hours parked for each customer. Your program should print the results in a neat tabular format and should calculate and print the total of yesterday’s receipts. The program should use the function calculateCharges to determine the charge for each customer. Your outputs should appear in the following format Sample output Enter the hours parked for 3 cars: 1.5 4.0 24.0 Car Hours Charge 1 1.5 2.00 2 4.0 2.50 3 24.0 10.00 TOTAL 29.5 14.50Write a program to read basic salary (bsalary) and sales (sales) then calculate and print the net salary that represents bsalary + (commission comm) and if you know that the commission is calculated as follows: 2% of the basic salary, if sales are less or equal Three times the base salary comm = 0.02 * bsalary, 3% of the base salary if sales are more than three times the base %3D salary (comm = 0.03 * bsalary) 5% of the base salary, if sales are more than five times the base salary (comm = 0.05 * bsalary) %3DWrite a program that computes the fuel efficiency for a multi-leg journey. The program will first prompt for the starting odometer reading and then get information about a series of legs. For each leg, the user enters the current odometer reading and the amount of gas used (separated by a space). The user signals the end of the trip with a blank line. The program should print the miles per gallon achieved on each leg and the total MPG for the trip.