Write a program (C++) to determine the cost of coffee based on the size entered by a user. Your program should support 3 different sizes. A Large coffee costs 5.99, a Medium coffee costs 4.99, and a Small coffee costs 3.99
Q: Write a C++ program that prompts the user for the length and the width of a rectangle. The program…
A: Start Input length Input width Calculate Area Calculate Perimeter Display Area Display Perimeter…
Q: Write a program in C++ to calculate and print the Electricity bill of a given customer. The customer…
A: Please find the answer below :
Q: Write a complete C++ program that asks the user for a number of gallons and then outputs the…
A: Write a complete C++ program that asks the user for a number of gallons and then outputs the…
Q: Write a program in c# that plays a guessing game with the user. Have your program read and store an…
A: C# program for the given problem:
Q: Write a program in C to calculate and print the Electricity bill of a given customer. The customer…
A: #include<iostream>using namespace std;int main(){ int customer_id, units; string name;…
Q: Write a progarm in C compiler that inputs three variable from the user of type: int, float and char.…
A: Please find the answer below :
Q: Write a C++ program that calculates the Perimeter of a circle. The main function asks the user to…
A: C++ is one of the most popular programming languages developed by Stroustrup at Bell Labs. The basic…
Q: Write a C++ program that allows the user to enter the last names of five candidates in a local…
A: Introduction of the Program: The C++ program takes 5 candidates names and votes from the user and…
Q: Write a C program to simulate tossing a “fair” coin. Allow the user to enter the number of tosses.…
A: Generate random number and divide with 2 If remainder is 0, consider it as HEADS or else TAILS
Q: Write a c program dist.that calculates the distance between two points and prints the result on the…
A: The code is given in step 2.
Q: Write a program in C that asks the user to enter a number of seconds and works as follows: • There…
A: Here we are given user input in seconds. We need to convert it into days, hours , minutes, seconds.…
Q: marks as given below. Calculate the overall percentage (sum of the total points earned divided by…
A: Given Write a program in C++ that calculates the total grade of a student for N number of quizzes.…
Q: Write a C Program to enter the details of 20 Food Items like Dish Name, Dish Price, Dish Discount on…
A: Code: #include <stdio.h> int main() { //Declare variables char dish_name[20][30];…
Q: Write a program in C++ to calculate the residual volume of placing a hard sphere inside a cube of…
A: A sphere is a three-dimensional object that is round in shape. The sphere is defined in three axes,…
Q: Write a program in C++ that takes your full name as input and displays the abbreviations of the…
A: Given: Write a program in C++ that takes your full name as input and displays the abbreviations of…
Q: Write a program in any programming language to caleulate and print the Electricity bill of a given…
A: - We have to code the electricity bill problem using the given charges. - We are using C++ here.
Q: Write a C- program that will calculate and print out bills for the city water company. The water…
A: Write a C- program that will calculate and print out bills for the city water company. The water…
Q: Write a program c++ that receives the date from the user in the form of 3 correct numbers, the…
A: Lets see the solution.
Q: write a program in C++ that A user needs to determine the size of squares (let say delta) in a grid,…
A: Answer: our instruction is answer the first three subparts from the first part. we have done code
Q: 3. Write a complete C program for a restaurant that takes the net profit of each day for 4 weeks…
A: Using procedural approach. Using two dimensional array to store daily salary.
Q: Trying to write a C# program, everytime l try and run it it fails and says they are errors.Below…
A:
Q: Write a C++ program to calculate the perimeter and area of a circle using the function float…
A: The program is written in C++ 1. initially iostream header file 2. function declaration 3. enter the…
Q: Write a program in C++ to calculate and print the Electricity bill of a given customer. The customer…
A: The below given C++ program will obey the following rubrics: Including necessary header files. In…
Q: Write a program in C that calculates the voltage value (V) of the voltage source using a Function.…
A: #include<stdio.h> float findVoltage(float R,int I){ float voltage; voltage=I*R;//voltage =…
Q: Write a C++ program that accepts an amount of money on deposit and a number of years it has been on…
A: #include<iostream> using namespace std; int main(){ float amount,interst,years;…
Q: Write a piece of C++ program that prompts the user for entering a number, say x, and prints: 1, 2,…
A: for (int i = 1; i <= num; i++) { cout << i << " "; } for (int i = num - 1;…
Q: Write a C ++ program that reads temperatures for 3 days and then calculates and prints average…
A: #include <iostream>using namespace std;int main() { int num1, num2, num3; cout <<…
Q: Write a complete C++ program that allows user the ability to enter an integer in the range of some…
A: 1)Prime numbers, with only two variables: 1 and the number itself, are cumulative numbers greater…
Q: Write a program in C++ that takes in a line of text as input, and outputs that line of text in…
A: Actually, the code has given below:
Q: Write a c program dist.c that calculates the distance between two points and prints the result on…
A: Given: Write a c program dist.c that calculates the distance between two points and prints the…
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 that accept the student registration number as input and print the product of…
A: Objective: This program reads the student registration number as user input and computes the product…
Q: Write a program in C++ language that reads three integers from the keyboard, then there is a cube…
A: #include<iostream> using namespace std; int main(){ int a,b,c,cube_a,cube_b,cube_c;…
Q: Write a C program that will ask the user to enter an integer number, then if the number even it will…
A: In the given question, we have to write C program that will ask user to enter an input(integer…
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 that given a specific amount of cents, it calculates the number of quarters,…
A: C++ code is given below
Q: Paste three test cases at the end of the program( put them in comment area)
A: C++ program to generate all combination of well formed parentheses
Q: Write a C program that reads the income of a person and calculates his total tax according to the…
A: C Program for above : #include <stdio.h> int main() { double salary; //get the…
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: 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: Write a program in c++ to read the radian of a circle, check if it is bigger than zero, and if it is…
A: Required: Write a program in c++ to read the radian of a circle, check if it is bigger than zero,…
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 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: sor works to read the pollution value in four industrial sites every four hours a day, so you want…
A: Goal: get pollution reading from the sensor using c++ program for 4 sites and calculate pollution…
Q: Write a program in c++ to read the radian of a circle, check if it is bigger than zero, and if it is…
A: ask the user to give the radius of the circle as input pass the radius as to the function called…
Q: Write a program in C language to simulate tossing a “fair” coin. Allow the user to enter the number…
A: Write a program using c language that will take a number of tosses as input and find the number of…
Q: Write a C++ program which asks for a student's test score, and then spits out the grade that they…
A: Given: Write a C++ program which asks for a student's test score, and then spits out the grade that…
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…
Step by step
Solved in 3 steps with 1 images
- Write a C++ Program for the given instructions: Instructions Write a program to implement the algorithm that you designed in Exercise 19 of Chapter 1. Your program should allow the user to buy as many items as the user desires. Instructions for Exercise 19 of Chapter 1 have been posted below for your convenience. Exercise 19 Jason typically uses the Internet to buy various items. If the total cost of the items ordered, at one time, is $200 or more, then the shipping and handling is free; otherwise, the shipping and handling is $10 per item. Design an algorithm that prompts Jason to enter the number of items ordered and the price of each item. The algorithm then outputs the total shipping and handling fee, and the billing amount. Your algorithm must use a loop (repetition structure) to get the price of each item. (For simplicity, you may assume that Jason orders no more than five items at a time.)The programming language is C++, write a program base on the given statement. Write a program that reads in the sales expenses of the Short DistanceTelephone Company for the past year and then calculate the profitand the next tax based on the ff. table PROFIT TAX RATE0 – 10000 010001 – 30000 100 + 3% OF THE PROFIT30001 – 50000 200 + 5% OF THE PROFITOVER 50000 300 + 7% OF THE PROFITIllustrate your knowledge of C-Programming by implementing a ‘Game of Dice’.User will start with 3 lives and 100 initial points. Program will ask the user to roll three dices. If sum of three dices is more than or equal to 15, user will get 10 points. If sum is in the range 10 to 14, user will get 5 points. If sum is less than 10, user will get -10 points. If sum is 3, user will lose one life. For every increase of 50 points, user will get one new life and for every decrease of 50 points, user will lose one life. If at any point, user has 200 or more points, program will display message, ‘Congratulations, You Win!!!’ and end. If user has zero lives or zero points, program will display the message ‘Game Over. Sorry, You Lose.’ and end.Program will use the following user defined functions to implement the game Function ‘DisplayGameRules()’ will display the following message on screen.############################################## ROLL the DICE GAME…
- Write a C++ program that helps a person decide which mode of transportation they should take to get them to their destination on time. It should ask the user for 3 things: how far they are traveling in kilometers, what time of day it is (morning, afternoon, or evening), and how many minutes from now they have to be there. The program should then reply with all of the modes of transportation that will get them there on time (some might be too slow and won't work). If a particular mode does not work, it should not be listed. Here are the speeds of each mode by time of day: morningsubway: 30km / hourcar: 23km / hourwalking: 6km / hour afternoonsubway: 62km / hourcar: 60km / hourwalking: 6km / hour eveningsubway: 32km / hourcar: 44km / hourwalking: 6km / hourwrite a program in c++ in which A Paint Company has asked you to write an application that calculates the quantity and price of Paint required to a paint for rectangular rooms in a building. To calculate the quantity of paint required, you have to first calculate area of room, assuming one gallon is enough for 120 square feet. Then for price you multiply the quantity of paint by the price per gallon. For example, the area of room that is 34 square feet. To cover that room with paint that costs 1000 per gallon would cost (1/120*34=2.83 gallon, 2.83*1000=2833rs).(you can take help from internet for exact formulas) First, you should create a class named RoomDimension that has two attributes: one for the length of the room and one for the width. The RoomDimension class should have a member function that returns the area of the room. Once you have written the class, use them in an application that asks the user to first enter total number of rooms, create a dynamic array, then ask user to…Write a C++ program that helps calculate how long it would take a user to pay off a loan with compound interest. You should prompt the user for the principle amount, how much interest is being charged, and how much they are able to pay back each month. You should assume that all amounts are in dollars and cents, that interest is charged monthly, and that payments are also made monthly. The program should display a table with the following columns: the month number, the amount remaining on the loan, and the total amount already paid. For *each* row, you should: 1. *FIRST* subtract the payment from the amount remaining on the loan.2. *THEN* add interest based on this new total amount. You should continue to print out rows in the table until either the amount remaining is <= $0 or if 100 months have passed. Then, print out a summary showing the number of months that will elapse and how much total has been paid. If the table stops at 100 months, print out a message telling the user that…
- Write a C++ program that calculates the base of a polygon (ie., b). The main function asks the user to input the value of the height (1.e, h), and area (1.e., A) of the polygon. Then the main function calls another function to calculate the base of the polygon (Name this function as a base_polygon). Finally, the main function displays the base of the polygon. Recall that :b = 25 hs bWrite a C++ program that calculates and displays the avarage mark (in percentage - %) of 3 modules for 30 students in a class. The student name and the marks for 3 modules must be inputed by the user. Only display a list of students who has a pass avarage of 50% or higher.Note: Please answer in C++ Programming language. During Eid, it is a tradition for every father to give his children money to spend on entertainment. Chef has N coins; denote the value of the coin i by vi. Since today is Eid, Chef gives one coin to each of his two children. He wants the absolute value of the difference between the values of the coins given to the two children to be as small as possible to be as fair as possible. Help the chef by telling him the minimum possible difference between the values of the coins given to the two children. Of course, the chef cannot give the same coin to both children. Possible input 1 3 142 Required Output 1
- 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…a C++ program that recommends the number of calories a person should eat each day. Calories are units of energy found in all foods. Base your recommendation on the person's weight and whether the person has an active or sedentary (inactive) lifestyle. If the person is sedentary, that person's activity factor is 13. If the person is active, that person's activity factor is 15. Multiply the activity factor by the person's weight to get the recommended number of calories. Start your program by: having the user enter their weight, as a floating point number; having the user enter whether they have active or sedentary lifestyle, as a character, 'A' for active or 'S' sedentary; use a switch (or else if) selection statement to use the appropriate calculation for the recommended calories for the selected lifestyle. · print out your results on the screen.Write a C++ code to develop a software for your burger shop that takes orders for a tasty burger from the user, in just 5 steps. Attached below is the menu that you are going to display to the user in a nice attractive format. User can only add one type of bun to the burger. Maximum two types of cheese, 1 item from the category “turn up the taste”, maximum 3 from fresh’N it up and 3 from the sauces. If the user presses 0 then you are going to skip that category (user cannot skip “choose your bun” and “turn up the taste”).Each element from the “choose your bun” costs .72$Each element from the “make it cheesy” costs .5$Each element from the “turn up the taste” costs 1.2$Each element from the “fresh’N it up” costs .2$Each element from the “get saucy” costs .3$After taking the input from the user. Total cost will be displayed for the burger in $.NOTE: This question should be attempted using switch and nested ifs.