Your friend is the owner of pizza restaurant. She'd like you to write a program that will tell her what her revenue would be based on the number of small and large pizzas sold. Small pizza price = $9.50. Large pizza price = $15.50. Have the user able to use one input statement for both small and large pizzas sold. Set precision to two decimal places and set the width for all output to twelve spaces. Display the results like this: Small Pizzas 95.00 Large Pizzas 155.00 Total 250.00
Q: You can find out how many seconds have elapsed since Jan 1, 1970 using the time() function.…
A:
Q: You were hired by PAGCOR as part of programming team in-charge of automating its BINGO game. Your…
A: Step 1: Accept Number n form user Step 2: if Number between 1 to 15 the print "That's Letter 'B' in…
Q: Write a program that asks the user to enter the width and length of an office in feet. Once these…
A: The code is written below in cpp-…
Q: Write a program that prompts the user to enter two integer numbers x and y. The program must check…
A: Since , their is no any specific language is mentioned for writing a program so program is written…
Q: Write a program for The Carefree Resort named ResortPrices that prompts the user to enter the number…
A: C# is a general purpose multi-paradigm programming language developed and used by Microsoft. It…
Q: You are to write a program to tell you how many months it will take to pay off a loan, as well as…
A: Following is the code for the loan calculator using C++
Q: I'm stuck on this problem, and here's what I'm stumped on: Meadowdale Dairy Farm sells organic brown…
A: The Answer is
Q: Write a program which takes two numbers as input from user and determines which is the larger of the…
A: The above program is solved using MIPS MARS below:
Q: I am stuck on this problem- this is the question: Meadowdale Dairy Farm sells organic brown eggs to…
A: Note: Below is the required program in java language. Programming Approach: Importing necessary…
Q: Help me fix my code. I don't know how to handle it so that when I enter the number 1256789, it will…
A: Code is given below :
Q: Write a program that does the following. Ask the user to enter 10 positive integer values from the…
A: Program Approach: Including the necessary header file. Defining the main method. Deffining an…
Q: What is output by the code below? hour = 22 if hour > 12: %3D print(hour-12, "O'Clock") else:…
A: given program is hour=22if( hour>12): print(hour-12,"O'clock")else: print("10 o clock")
Q: Need help with the code for this question: Write a program that prompts the user to input an…
A: Programming language is missing in the question. So we will answer this program in C++ languages. If…
Q: You are given the code below. It's a game where the user has to guess a sequence of four 1-digit…
A: check further steps for the answer :
Q: Write a program that asks for the starting time and the number of minutes of the call, and displays…
A: Algorithm: Start Read time Validate time, if it is greater than 23.59, display invalid time.…
Q: To print out a and b given below, which printf() statement would you use? float a = 3.14; double b =…
A: To print out a and b the given printf() statement will use
Q: how do you Write a program that prompts the user to input two POSITIVE numbers — a dividend…
A: PROGRAM STRUCTURE: Include all the required header files. Include iostream for using input output…
Q: Your relative, who goes to primary school and has just learned the multiplication table, asks you to…
A: using System; public class Multiplication { public static void main() { int i,n,count=0;…
Q: Driving is expensive. Write a program with a carsiles/gallon and gas dollars gallon (both floats) as…
A: C++ programming language is used to answer the given question. The formula to calculate the cost of…
Q: Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output…
A: import java.util.*;class Test89 { public static void main(String args[]) { Scanner sc = new…
Q: Write a program that prompts the user to enter the name of a football team and its foundation year.…
A: The programming languages include Java, c, c++. The program reads the input from the user that is…
Q: Write a program that prompts the user to input three numbers. The program should then output the…
A: The given is the requirement to solve the problem in C++ programming lanague where: a) User will…
Q: Write a program that asks the user to type in a time in seconds and display it in the standard…
A: Program code: //include the required header files #include<stdio.h> //define main functions…
Q: Write a program that prompts the user to input three numbers. The program should then output the…
A: #include<iostream> #include<algorithm> using namespace std; int main(){ cout…
Q: Write a program that will ask the user to input three integer values from the keyboard. Then it will…
A: #include <iostream>#include <conio.h>using namespace std;int maxval(int, int,int);int…
Q: question, you are required to write a program that takes as an input any decimal number (with…
A: the code is an given below :
Q: You want the output to be: one line of vertical bars, spaced so that they always appear above the 0…
A: the solution is an given below :
Q: Consider the code below. What is the output for x = 69? if x 10: print('Greater than 10') elif x >…
A: Question given - A Python code segment is given, that check a multiple if - elif - else statement…
Q: You are required to write a program to compute the area of square (area = side) OR a triangle (area…
A: Required:
Q: ask the user to input one of the characters a, b, c, d, e, q read in a character from the keyboard…
A: In main a while loop is used to ask for user input of a character. If character equals a then…
Q: Sam is creating a code to determine whether an inputted value, x, is a positive or negative number.…
A: The correct answer along with the explanation is given below:
Q: Write a program that accepts a number corresponding to a plane figure: Right Triangle Rectangle…
A: The program first ask user to select the shape for which he wants to calculate area and perimeter.…
Q: Write a program that asks for the starting time and the number of minutes of the call, and displays…
A: The total cost of the call is calculated based on the duration of minutes.
Q: Write a program that prompts the user to enter an integer and determines whether it is divisible by…
A: Since there is no programming language, below is the program in python.
Q: Write a program that will convert miles to kilometers and kilometers to miles. The user will…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: Output each floating-point value with two digits after the decimal point, which can be achieved as…
A: Here is the c program of above problem. See below step for code.
Q: Write a program that converts temperature from Fahrenheit to Celsius and vice versa.
A: Dear Student below is the Java code provided for Fahrenheit to Celsius and vice versa conversion.
Q: Write a program that prompts the user to enter the exchange rate from currency in U.S. dollars to…
A: Write a program that prompts the user to enter the exchange rate from currency in U.S. dollars to…
Q: Write a program that asks for the starting time and the number of minutes of the call, and displays…
A: Input: starting time of the talk; Duration of the talk in minute; output: charge for taking…
Q: erent variables. The program should first calculate the sum of these five variables and store the…
A: Write a program that stores five values in five different variables. The program should first…
Q: Write a program named FahrenheitToCelsius that accepts a temperature in Fahrenheit from a user and…
A: Program: using System;//create classclass FahrenheitToCelsius { //main method static void Main()…
Q: Write a program that can determine the number of days in a month for a specified month and year. The…
A:
Q: Given an airplane's acceleration and take-off speed v, you can compute the minimum runway length…
A: The given problem can be solved using simple arithmetic operations in any programming language.…
Q: Your program must keep on prompting the user if an incorrect time was given; see below for examples.…
A: C program used to answer this question
Q: Write a program with total change amount in pennies as an integer input, and output the change using…
A: def exact_change(user_total): user_total = int(input('Enter change: ')) if user_total <= 0:…
Q: C# Write a program for The Carefree Resort named ResortPrices that prompts the user to enter the…
A: Algorithm: Start Read enter the number of days for a resort stay n If n==1 or n==2,calculate cost…
Q: Mr. Allan is a salesman and travels around UAE to check the different stores from Sunday to…
A: Please find the answer below :
Q: For this problem, you are going to design a game for the children to teach them about numbers. You…
A: As the programming language is not specified answer written in C++ 1)For this we have to use…
need this done in c++
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- For this question, you will write a program that prompts the user to enter an integer value between 1 and 1000 (exclusive). Your program should then print out a sequence of numbers between the given value and 1 (inclusive) following the pattern below:For a given number ai, If ai is even, then ai+1 = floor(ai / 2) If ai is odd, then ai+1 = 3ai + 1 Your program should stop printing numbers once the sequence reaches the value of 1. If the user enters a number that is not between 1 and 1000 (exclusive), print "Invalid input." and prompt the user for a number again. This sequence is referred to as the Collatz sequence. The Collatz Conjecture states that this sequence will eventually reach the value of 1 for any starting number, a fact that has not yet been proven by modern mathematics! Note: floor(x) means that x should be rounded down to the nearest integer.I'm stuck on this problem, and here's what I'm stumped on: Meadowdale Dairy Farm sells organic brown eggs to consumers in the surrounding area. For a dozen eggs, it charges $3.25, and for individual eggs that are not part of a dozen, it charges 45 cents each egg. Using the following phrasing, write a program that prompts a user to enter the number of eggs in the order and then displays the amount owed along with a detailed explanation of why the amount is due: You placed an order for 27 eggs. There are 2 dozen eggs at $3.25 per dozen and 3 loose eggs at 45 cents each, which adds up to a total of $7.85.I am stuck on this problem- this is the question: Meadowdale Dairy Farm sells organic brown eggs to local customers. It charges $3.25 for a dozen eggs, or 45 cents for individual eggs that are not part of a dozen. Write a program that prompts a user for the number of eggs in the order and then display the amount owed with a full explanation using the following wording: You ordered 27 eggs. That’s 2 dozen at $3.25 per dozen and 3 loose eggs at 45 cents each for a total of $7.85.
- Here is a classic “introduction to computer programming” problem: Write a program that converts temperature from Fahrenheit to Celsius and vice versa. The program will accept a number (temperature) and a temperature unit designation (i.e., character F or C) from the user, and then convert the temperature into the other unit system. The program will echo the input as part of the final conversion output. The temperature units should be printed in full (Fahrenheit or Celsius). Your program should use real numbers—not integers—for both input and output. Formula: T(F) = (T(C) * 9 / 5) + 32T(C) = (T(F) − 32 ) * 5 / 9 Sample Run: This program converts Temperatures from Fahrenheit to Celsius and vice versa. Please enter your temperature: 32 Please enter the units (F/C): F A temperature of 32 degrees Fahrenheit is equivalent to 0 degrees Celsius. Do you wish another conversion? (Y/N): Y Please enter your temperature: 100 Please enter the units (F/C): C A temperature of 100 degrees Celsius is…Write a program that asks for the starting time and the number of minutes of the call, and displays the charges. The program should ask for the time to be entered as a floating-point number in the form HH.MM. For example, 07:00 hours will be entered as 07.00, and 16:28 hours will be entered as 16.28. Input Validation The program should not accept times that are greater than 23:59. Also, no number whose last two digits are greater than 59 should be accepted. Hint: Assuming num is a floating-point variable, the following expression will give you its fractional part: num – static_cast<int>(num);1. Convert a distance from miles to kilometers. There are 5,280 feet per mile, 12 inches per foot, 2.54 centimeter per inch and 100,000 centimeters per kilometers. Format your output to have two decimal places. 2. Write a program to convert a measurement in centimeters to feet and inches. The number of centimeters should be read as input. There are 2.54 centimeters in each inch and 12 inches in each foot. Format your output to have two decimal places. 3. Write a program that will read a weight in pounds and convert it to grams. Print both the original weight and the converted value. There are 454 grams in a pound. Format your output to have two decimal places. 4. Write a program that inputs a number of hours and output the equivalent number of weeks, days and hours. 5. Write a program that will convert the read-in time in seconds to number of hours, minutes and seconds 6. Write a program that will derive the number of years, months and days from an input in days. Use 365 as the total…
- : Carefully read the instructions and write a program to convert between KPHand MPH in either direction.If you are driving across the border into Canada, it is difficult with the road signs in KPHvalues. In Canada, the Kilometers Per Hour (KPH) scale is used to measure speed. In theU.S., the Miles Per Hour (MPH) scale is used. For example, a speed limit of 50 MPH in Vermontis 80.47 KPH in Montreal. A speed limit of 60 KPH in Toronto is 37.28 MPH in Buffalo, NY.You’d like your computer or smartphone to convert between the Speed limit signs so you donot get a ticket.Design a program to• show a menu of choices;• ask the user which operation they want;• read in the user response;• compute and display the resultUse the following formula• 1 MPH=1.60934 KPH• 1 KPH = 0.62137 MPHIn summary, design a program to• show a menu of choices and ask the user which conversion they want:Convert Kilometers Per Hour or Miles Per Hour:**Enter 1 for KPH to MPH**Enter 2 for MPH to KPHWhich conversion do you…Need help with the code for this question: Write a program that prompts the user to input an integer and then outputs both the individual digits of the number and the sum of the digits. For example, it should output the individual digits of: 3456 as 3 4 5 6 8030 as 8 0 3 0 2345526 as 2 3 4 5 5 2 6 4000 as 4 0 0 0 -2345 as 2 3 4 5Suppose you want to deposit a certain amount of money into a savings account, and thenleave it alone to draw interest for the next 10 years. At the end of 10 years, you would like tohave $10,000 in the account. How much do you need to deposit today to make that happen?You can use the following formula, which is known as the present value formula, to find out:The terms in the formula are as follows: [5 marks]• P is the present value, or the amount that you need to deposit today.• F is the future value that you want in the account. (In this case, F is $10,000.)• r is the annual interest rate.• n is the number of years that you plan to let the money sit in the account.Write a method named presentValue that performs this calculation. The method should accept the future value, annual interest rate, and number of years asarguments. It should return the present value, which is the amount that you need to deposit today.Demonstrate the method in a program that lets the user experiment with…
- The screen size of a TV is given by the length of the rectangular diagonal. Traditional TVs come in 4:3 ratio, that is, the ratio of length to width is 4 to 3. This means, if the length is x inches, then the width is (3/4)x. LCD TVs come in 16:9 ratio. Write a program that prompts the user to input the length of the diagonal (in inches) of the screen and allows the user to select which type of TV’s screen length, screen width, and screen area the user would like to calculate. Have the program display the desired results.You arrive in front of a bridge that you must cross to reach a village before dark. Crossing the bridge is not free - the bridgekeeper asks you to roll two dice to determine the cost. You decide to write a program to verify that he is charging the right price. Your program should read two integers, between 1 and 6, representing the values of each die. If the sum is greater than or equal to 10, then you must pay a special fee (36 coins). Otherwise, you pay twice the sum of the values of the two dice. Your program must then display the text "Special tax" or "Regular tax" followed by the amount you have to pay on the next line.Your program must keep on prompting the user if an incorrect time was given; see below for examples. The program then converts the time into the usual US format with hours from 1 to 12, the minutes and an AM or PM marker. This conversion works like follows: • 0 hours become 12 o’oclock AM, • 1 through 11 hours become 1 through 11 hours AM, • 12 hours become 12 o’clock PM, • 13 through 23 hours become 1 through 11 hours PM, with a subtraction of 12. The program then displays the time in the usual US format. Please use care when displaying the minutes, as an extra zero needs to be displayed for minutes 0 to 9. See the examples below for details. Examples of input and output: Please enter the hours on a 24 hour clock (0-23): 15 Please enter the minutes (0-59): 7 You entered 3:07PM Please enter the hours on a 24 hour clock (0-23): 27 Please enter the minutes (0-59): 17 Sorry, your input is incorrect. Write a program clock.c that asks the user to input a moment in time as an hour…