Write a complete C++ program that asks the user for a number of gallons and then outputs the equivalent number of liters. There are 3.78533 liters in a gallon. Use a declared constant. Since this is just an exercise, you need not have any comments in your program.
Q: Write a python program to check if a variable, x, is divisible by 2, 3 or 5. If it is divisible by…
A: The question is to write python code for the given problem.
Q: Write a c++ program that loop 4 times each time it prompts the user to enter a name of car and its…
A: Program plan:- 1. Include header file. 2. Using the namespace function. 3. Define the main function.…
Q: Write a c++ program to read 15 different numbers then find out how many even and odd in them? then…
A: Algorithm: Start Read 15 numbers and store them in an array Initialize evenCount=0,oddCount=0…
Q: Write a C Program that allows a user to enter any number of student test scores until the user…
A: Program: TestScoreStatistics.h #ifndef TestScoreStatistics_H #define TestScoreStatistics_H…
Q: 2. Write a complete program that prompts the user for a test score and prints out the letter score…
A: Given: Write a complete program that prompts the user for a test score and prints out the letter…
Q: 2. Write a complete program that prompts the user for a test score and prints out the letter score…
A: Here I written Java code for given problem. I hope you like it.
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 complete C program to read a string from the user at the runtime then, change every e or E…
A: PROGRAM CODE: #include<stdio.h> int main(){ int i=0; char s[50]; printf("Enter String…
Q: Write a C++ program that generates a plate number based on the user’s answer to the following…
A: Step 1 : Start Step 2 : In the main function, declare and initialize the number plate string with…
Q: Write a program that computes and assesse the tuition fee of the students in one semester, based on…
A: Algorithm: 1. Start. 2. Read the tuition fee as tuition_fee. 3. Read payment mode (Press (1) - Cash,…
Q: Write a C++ program that takes as input an arbitrary number of red blood cell counts in the range 0…
A: #include <iostream>using namespace std; int main() { int i, count ; float…
Q: Write a C++ program that tells the user that the number entered is less than or greater than 10?…
A: #include<iostream> using namespace std; int main(){ int n; cout<<"Enter the value…
Q: write a program in VB that requires from user to insert the total number of students and the number…
A: ' Program that reads total student and successful student and calculate' and display percentage of…
Q: Write a C++ program that allows a user to enter their rating of the three movies in the Dark Knight…
A: The answer is in below steps:
Q: Write a c++ program that loop 4 times. Each time it prompts the user to enter a name of a car and…
A: Objective: This program reads the name and price of four cars and displays the name of the cars with…
Q: Write a C# program that lets the user enter an object’s mass and then calculates its weight. If the…
A: using System; namespace ConsoleApplication1{ class Program { static void Main()…
Q: Write a C program that reads in the mass of two bodies and the distance between them and then…
A: Using const keyword, we can declare a constant. Here we are dealing with decimal values and as…
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: In this lab, you complete a partially written Python program for an airline that offers a 25%…
A: # Passengers who are 6 years old or younger # (passengerAge <= 6) # Passengers who are 65 years…
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 C++ program that finds either a user given number is Armstrong or not. If it is Armstrong…
A: Below is the required C++ program: - Approach: - Include the header file and use the namespace.…
Q: Write a program in C++, to read a number and calculate the average of its digits, and the largest…
A: the c++ program which calculate avg of digits in entered num and also show largest digit is given…
Q: Write a python program to check if a variable, x, is divisible by 2, 3 or 5. If it is divisible by…
A: num = int(input())isDivisible = False if num % 2 == 0: isDivisible = True print('Divisible by…
Q: Write a complete C program to read a string from the user at the runtime then, change every e or E…
A: Task :- Write a C program to read a string from user input, change every e or E with the digit 3 and…
Q: f. Write a JAVA program to calculate the determinant using the formula B? - 4*A*C, and then…
A: Given, We have to write a JAVA program to calculate the determinant using the given formula. Given…
Q: Write a C program that prints out your name(Batambuze Joshua) and your registration…
A: Given: Write a C program that prints out your name(Batambuze Joshua) and your registration…
Q: A. Write a program in "SUM.C" which reads two integers and prints out the sum, the difference and…
A: To do: Find sum, difference, product, division and remainder of two numbers. The program ask user to…
Q: integer between 0 and 100,
A: Ask a user to enter an integer between 0 and 100, then tell the user whether it can be evenly…
Q: Write a FORTRAN90 program that reads a student ID and his GP he program should print a message…
A: 1- In this assignment require, two input studentID, GPA, and display output according to them using…
Q: Write a program to read in a collection of 5 exam scores ranging from 1 to 100. Your program should…
A: Program plan: Create an array and declare the respective variables Prompt for the 5 numbers from…
Q: Write a c program that ask in the value from the user and compute then produce the output as follows…
A: Program approach:- // using header file. // function definition. // print as required. // if Tables…
Q: Write a program c++ to read the birth date (year, month, day) and read the current date (year,…
A: The first step is the header statements used to take the input and output statements from the users.…
Q: In C++, write a program that generates a random number for (x) to calculate A with the given…
A: I have added the comments. I have also added 3 output samples to show that every time a different…
Q: write a program in C++ using if-else or switch for calculating electricity bill, the range of the…
A: GIVEN: write a program in C++ using if-else or switch for calculating electricity bill, the range…
Q: . Write a c++ program that tells what coins to give out for any amount of change from 1 cent to 99…
A: Programming instructions: Declare the required variables. Use a do-while loop that allows the user…
Q: Write a C++ Program using using classes, that, given a number greater than zero (0), the user will…
A: The complete code is a given below .
Q: c++ to store the roll no. (starting from 1), name and age of 5 students and then print the details…
A: Create a class studnt with private roll_no, name and age variables. Declare a get() method to get…
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: In python, write a program that receives an integer, greater than or equal to 2, from the user and…
A: What is Python? Python is a widely used high-level, general-purpose programming language for…
Q: Write a C program that requires a user to input weight and height so that it can calculate weight to…
A: Given: Write a C program that requires a user to input weight and height so that it can calculate…
Q: 2. Write a complete program that prompts the user for a test score and prints out the letter score…
A: //2import java.util.Scanner;//to reading input from userpublic class Main{ public static void…
Q: write a program in c++ Language that require from user to insert the total number of students and…
A: #include <iostream> using namespace std; int main(){ //Variable declaration float…
Q: 1. Write a complete C program that reads the temperature of five cities in the last week then print…
A: Please give positive ratings for my effort. Thanks. PROGRAM…
Q: Write a C# program using a switch statement that switches on the variable name. If the name is…
A: HI THEREI AM ADDING C# CODE AS PER REQUIREMENT BELOWPLEASE GO THROUGH ITTHANK YOU
Q: Write a program (C,C++ or any other language) where a shop owner can input daily sales and calculate…
A: I am using c++ Algorithm: Start Read no.of days n Read sales for n days in an array a Read price of…
Q: Write a program that reads a C program and prints in alphabetical order each group of variable names…
A: #include<stdio.h>#include<string.h>#include<stdlib.h> #define BUFSIZE 1000#define…
Q: Write a complete C++ program that reads two whole numbers into two variables of type int and then…
A: #include<iostream>using namespace std;int main(){int…
Write a complete C++
Step by step
Solved in 2 steps with 1 images
- A parking garage charges a $20.00 minimum fee to park for up to three hours. The garage charges an additional $5.00 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24- hour period is $50.00. Assume that no car parks for longer than 24 hours at a time. Write a program that calculates and printsthe 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: Car Hours Charge1 1.5 20.002 4.0…Write a program that reads the volume, V, as a floating-point number. It then computes and prints the radius of a sphere having volume V, and then computes and prints the height of a cylinder having the same radius and the same volume V. You may use math library functions if necessary.Enter the year in two epochs, determine the leap year during this period, and print ten years each on the output. Please write it as a function, the parameter you pass is the year of the two epochs. The format of the output result is the same. In Java
- 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 temperature-conversion program that gives the user the option of converting Fahrenheit to Celsius or Celsius to Fahrenheit. Then carry out the conversion. Use floating-point numbers. Interaction with the program might look like this: Type: 1 to convert Fahrenheit to Celsius, 2 to convert Celsius to Fahrenheit: 1 Enter temperature in Fahrenheit: 70 In Celsius that’s 21.111111Write a program that plays a guessing game with the user. The user should pick a letter, and the computer should try to guess the letter. After each guess, the user should tell the computer whether its guess was too high or too low. With this information, the computer should be able to guess the letter within five tries. The user should be able to give whole words or single upper or lower case letters as responses. c++
- In C++ , Write a program for a Bookstore to take an order from a customer, calculate how much to charge a customer based on his/her order, and display a receipt. The store sells only three books, designated by their authors: Cervantes ($41.25 each), Homer ($15.85 each), and Shakespeare ($30.50 each). Your program is to work as follows: Display a welcome message (e.g., “Welcome to the Bookstore!”) Prompt the user for his/her first name Prompt the user to input the number of books by Cervantes s/he wants Prompt the user to input the number of books by Homer s/he wants Prompt the user to input the number of books by Shakespeare s/he wants Compute the total amount due, including a 10% sales tax Display amount due Ask the user how much money s/he will pay Display a receipt listing the name of the user, the quantity of each item ordered, the total cost of the order, and the amount the user will have left after paying Execution of the compiled program should appear roughly as follows…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.Use your previous working Java program as a starting point (Project 3). Create another function that determines whether the customer should receive a discount. Assume your food truck gives a 10% discount on orders over $50 (the total BEFORE tax). If the order is eligible for a discount, then calculate and display the discount. If the order does not get a discount, then still display the discount, but it should be 0. Include a line before this that tells every customer that your business gives a 10% discount on all orders over $50 so they understand this part of their receipt. You will also create two classes, one for existing project two called foodTrack and another class called foodDiscount that extends foodTrack. This is project 3: //initialize program import java.util.Scanner; public class Main { finalstatic String items[]=new String[]{"FRIES","CHEESESTEAK","BISCUIT","SALADBOWL","DONUTBOX","SALESTAX"}; finalstaticfloat…
- Write a program in Java Write a program that has variables to hold three test scores. The program should ask theuser to enter three test scores and then assign the values entered to the variables. The programshould display the average of the test scores and the letter grade that is assigned forthe test score average. Use the grading scheme in the following table:Rock Paper Scissors Lizard Spock (RPSLS) is an extended version of the classical game of chance Rock Paper Scissors. This game is created by Sam Kass and Karen Bryla. In this game, the players pick one of the following variables: rock, paper, scissors, lizard, spock. The outcome of the game is determined by the rules below specifying which variable defeats the other. If both players choose the same variable, the game ends in a draw. Rules: • scissors cut paper • paper covers rock • rock captures lizard • lizard poisons spock • spock smashes scissors • scissors captures lizard • lizard eats paper • paper disproves spock • spock vaporizes rock • rock crushes scissors In this project, you will write a program that takes two strings representing the choices of the players as inputs and prints the outcome of the RPSLS game. There are three possible outcomes of this game: a tie, a win for player 1 and, a win for player 2. You are supposed to determine the outcome depending on the players'…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.