21. GeeBees Clothiers is having a sale. The store manager wants a program that allows a salesclerk to enter the original price of an item and the discount rate. The program should calculate and display the amount of the discount and the sale price. The algorithm in Figure 2-21 is supposed to solve this problem, but it is not working correctly. Correct the algorithm, and then desk-check it using an original price of $100 and a discount rate of .25 (the decimal equivalent of 25%). Output: discount sale price oviginal príce discount rate Imput: Algorithm: 1. enter the original price and discount rate 2. calculate the sale price by subtracting the discount from the original price 3. display the discount and price
Q: Mad Libs are activities that have a person provide various words, which are then used to complete a…
A: Find Your Code Below
Q: Q2: Write a program in C++ to read ten students' name and degrees then calculate the average degree…
A: The program has to be designed as follows: Create arrays for storing names of students. Create…
Q: Programming Problem 1. Rock, Paper, Scissors This is your traditional rock-paper-scissors game,…
A: Lets see the solution in the next steps
Q: C++ Programming The Card Game One day, Fred and his N friends were playing a card game in which each…
A: Required: We have to write a code to maximize the sum which we get on the front cards, keeping in…
Q: Activity #2: Taking limits to compute derivatives Write a program named Lab5a_Act2.py to compute a…
A: Actually. Python is a easiest programming language. It is a dynamically typed programming language.
Q: The first question: Write a program to implement the algorithm that you designed in Exercise 19 of…
A: The answer is in below steps:
Q: (Algebra: solve quadratic equations) The two roots of a quadratic equation ax? + bx + c = 0 can be…
A: For the question we need user to input value for a,b,c. Then we will check value of b^2 - 4ac And…
Q: 6. A microwave oven manufacturer recommends that when heating two items, add 50% to the heating…
A: Hey, since multiple questions posted, we will answer first question according to our policy. If you…
Q: ( MindTap - Cenage )Example 5-6 implements the Number Guessing Game program. If the guessed number…
A: The given program in C++ performs the below tasks: Generates a random number between 0 to 100 and…
Q: Exercise 7 Develop an interactive program that reads a dollar amount as an integer and then…
A: The following program illustrates an interactive program to read dollars and display its…
Q: Display basic salary, bonus and net salary
A: EXPLANATION--> Firstly input two variable named with salary and grade If grade is greater then…
Q: Mad Libs are activities that have a person provide various words, which are then used to complete a…
A: Use an infinite loop to accept the input and manually specify the condition to exit from loop
Q: C++ program where a user can input his weight and height and the program suggests him a suitable…
A: C++ used to answer this question
Q: C++ Angle Calculator Write a program that asks the user for an angle, entered in radians. The…
A: C++ Angle Calculator Write a program that asks the user for an angle, entered in radians. The…
Q: Based on the image attached, shows a statement of a program are in the incorrect order. Rearrange…
A: The Answer is
Q: An Auto Insurance Program Example - Write a program to determine the cost of an automobile insurance…
A: Program approach: Import Scanner package for input. Create a class. Create the main method. Create…
Q: C++ Programming The Card Game One day, Fred and his N friends were playing a card game in which each…
A: Algorithm: 1. First calculate the total sum of the input array as total_sum and store it. 2. Iterate…
Q: The program should ask the user to enter the following - Name - Age - Thename of the City - Thename…
A: C++ used to answer this question
Q: Singular to Plural. Create a program that accepts a word in singular, and produces the corresponding…
A: Note : Answering in python as no language is mentioned. Input : Input the word in singular. Output…
Q: IN PYTHON PLEASE AND FLOWCHART DRAWING COPUTERIZED PLEASE!! In many businesses across the…
A: Program:- import sysTotalAmount=input("Enter total cost of purchase: ") GivenCash=input("Enter…
Q: Programming Exercise 4.17 gives a program that plays the scissor, rock, paper game. Revise the…
A: Given: Programming Exercise 4.17 gives a program that plays the scissor, rock, paper game. Revise…
Q: Q2a) A milk carton can hold 3.78 liters of milk. Each morning, a dairy farm ships cartons of milk…
A: 2a) The code is given below: #include <iostream>#include <iomanip> using namespace…
Q: Activity #2: Write a program that computes parking fees for a garage with the fee structure given in…
A: Objective: This program reads the number of hours parked for vehicles and computes the total charge.…
Q: 12: guess.cpp) Write a program that plays a guessing game with the user. The user should pick a…
A: Code : #include <iostream> using namespace std; int main() { /* Welcome the user and…
Q: Mad Libs are activities that have a person provide various words, which are then used to complete a…
A:
Q: Here's my Instructions for my C++ program: Write a program to implement the algorithm that you…
A: EXPLANATION: The error is in “cin” statement while getting the “num_of_items”. You can use “\n”…
Q: Code a game of sudoku in C++ where the user needs to guess the missing numbers in the grid. The grid…
A: The code implementation is given in the below steps.
Q: Jane has opened a new fitness center with charges of 2500 per month so the cost to become a member…
A: Note : I have added the output screenshot. Also with total money made, the code prints members and…
Q: C# Programming The Card Game One day, Fred and his N friends were playing a card game in which each…
A: Required: We have to write a code to maximize the sum which we get on the front cards, keeping in…
Q: Exercise 6: Two points in a plane are specified using the coordinates (x1, y1) and (x2, y2). Write a…
A: Since it is unclear which question you want, my code below is answer to both questions 6 and 7.
Q: C# Programming The Card Game One day, Fred and his N friends were playing a card game in which each…
A: Given:
Q: Mad Libs are activities that have a person provide various words, which are then used to complete a…
A:
Q: Here's the instructions for my C++ program: Write a program to implement the algorithm that you…
A: PROGRAM: //Including the header file #include <iostream> //Including the namespace std using…
Q: Q6. Write prolog program that read student grades in AI course to find the number of student with…
A: Actually, program is a executable program that runs on a computer.
Q: C++ Programming The Card Game One day, Fred and his N friends were playing a card game in which each…
A: Required: We have to write a code to maximize the sum which we get on the front cards, keeping in…
Q: Activity #2: Taking limits to compute derivatives Write a program named Lab5a_Act2.py to compute a…
A: Since you are asking multiple questions, we are answering first question for you. If you want…
Q: Q # 3. Implement a Tour Planner and Budget Calculator for Holidays. Program will ask the user to…
A: Include the Header files In main function Declare the variables estexpense, hotelexpense, person,…
Q: Mad Libs are activities that have a person provide various words, which are then used to complete a…
A: C++ and python code for the given program is given below
Q: A business law class of 25 students takes a midterm exam that has 100 true- or-false questions. The…
A: We need four arrays in this problem. The array KOUNT stores the number of times a grade is achieved…
Q: Q3. Write a payroll program using following rules: Hourly rate: ask user - If an employee works 40…
A: Sample Response: //C++ program to calculate total pay#include <iostream>using namespace std;…
Q: Write a program that will ask for a sentence and letters to cross out. It should then print the…
A: The question is to write C++ code for the given problem.
Q: C# Programming The Card Game One day, Fred and his N friends were playing a card game in which each…
A: Required: We have to write a code to maximize the sum which we get on the front cards, keeping in…
Q: 1. Write a program to play rock-paper-scissors. The program should let the user determine whether it…
A: from random import randint #create a list of play optionst = ["Rock", "Paper", "Scissors"] #assign a…
Q: Crispies Bagels and Bites wants a program that allows its salesclerks to enter the number of bagels,…
A: Input output flow
Q: Write a program that asks the user to enter two integers and prints the Difference, Product, Area of…
A: Step 1: Prompt and accept two integer values from the user. Step 2: Find the product and difference…
Q: C Program / C Language Make a C program. The date is january 1, 2019. Cody has a lot of neighbors…
A: Here, I have to write a C code to the above question.
Q: Lab #05 Exercise Write a program to enter 2 out of 3 angles in a triangle, in degrees. Your program…
A: Please give positive ratings for my efforts. Thanks. PROGRAM a = float(input("Enter the first…
Q: C++ Programming The Card Game One day, Fred and his N friends were playing a card game in which each…
A: Required: We have to write a code to maximize the sum which we get on the front cards, keeping in…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- Q1. a) The Little Man Computer (LMC) is an instructional model of a computer used to teach students all of the basic features of a modern computer in a simplified way. The following Little Man program is supposed to add two input numbers and output the result, i.e., OUT = IN1 + IN2 Mailbox Mnemonic code Numeric code 00 IN 901 01 STO 99 399 02 IN 901 03 ADD 99 199 04 OUT 902 05 COB 000 i) Change the program above to add the numbers 157 and 13. (Hint: these numbers are constants and therefore can pre-exist into memory before the execution of the program). No need to write both mnemonics and numeric codes (opcodes), either one is fine. Please refer to the instruction set provided for all the LMC instruction mnemonics and opcodes.7) The ideal gas law allows the calculation of volume of a gas given the pressure(P), amount ofthe gas (n), and the temperature (T). The equation is:V = nRT / PSince we only have used integer arithmetic, all numbers will be integer values with nodecimal points. The constant R is 8.314 and will be specified as (8314/1000). This givesthe same result. Implement the idea gas law program where the user is prompted for andenters values for n, T, and P, and V is calculated and printed out. Be careful toimplement an accurate version of this program. Your program should include a properand useful prompt for input, and print the results in a meaningful mannerThe first question: 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.) #include <iostream> using namespace std; int main() { float n, temp,totalPrize = 0; cout << "Enter the number of…
- (C++) A robot is initially located at position (0, 0) in a grid [−5, 5] × [−5, 5]. The robot can move randomly in any of the directions: up, down, left, right. For each move, print the direction of the move and the current position of the robot. If the robot makes a circle, which means it moves back to the original place, print “Back to the origin!” to the console and stop the program. If it reaches the boundary of the grid, print “Hit the boundary!” to the console and stop the program. A successful run of your code may look like: Down (0,-1) Down (0,-2) Up (0,-1) Left (-1,-1) Left (-2,-1) Up (-2,0) Left (-3,0) Left (-4,0) Left (-5,0) Hit the boundary! or Left (-1,0) Down (-1,-1) Right (0,-1) Up (0,0) Back to the origin!Exercise 3.9Modify program P34_1.cpp to compute the side area, total area, and volume of a cylinder and thearea and volume of a sphere, depending on the choice that the user makes. Your program shouldask users to enter 1 to choose cylinder or 2 for sphere, and display an "invalid choice error" forother values.For a cylinder, we want to compute:Side area: (2*PI*r) * hTotal Area: 2*(PI*r2) + Side areaVolume: (PI*r2)*hFor a sphere, we want to compute:Surface area: 4*PI*r2Volume: (4.0/3.0)*PI*r3.Use overloading whenever possible.Call your new program Ex39.cpp.Given a square matrix with the elements 0 or 1, write a program tofind a maximum square submatrix whose elements are all 1s. Your programshouldprompt the user to enter the number of rows in the matrix. The program then displaysthe location of the first element in the maximum square submatrix and thenumber of rows in the submatrix. Here is a sample run: Enter the number of rows in the matrix: 5 ↵EnterEnter the matrix row by row:1 0 1 0 1 ↵Enter1 1 1 0 1 ↵Enter1 0 1 1 1 ↵Enter1 0 1 1 1 ↵Enter1 0 1 1 1 ↵EnterThe maximum square submatrix is at (2, 2) with size 3 Your program should implement and use the following method to find the maximumsquare submatrix:public static int[] findLargestBlock(int[][] m)The return value is an array that consists of three values. The first two values arethe row and column indices for the first element in the submatrix, and the thirdvalue is the number of the rows in the submatrix.
- French Articles: French country names are feminine when they end with the letter e, masculine otherwise, except for the following which are masculine even though they end with e: le Belize le Cambodge le Mexique le Mozambique le Zaïre le Zimbabwe Write a program that reads the French name of a country and adds the article: le for masculine or la for feminine, such as le Canada or la Belgique. However, if the country name starts with a vowel, use l’; for example, l’Afghanistan. For the following plural country names, use les: les Etats-Unis les Pays-BasWrite a program to calculate total ordering cost. Jacob is a retailer for ice. Normally a bag of ice costs $2.5, but the price varies with the amount that he purchases. The following table shows the discount that Jacob receives. Order Volume Discount Rate >= 200 bags 25% off 120 - 199 bags 20% off 60 - 119 bags 15% off 40 -59 bags 10% off 20 – 39 bags 5.5% off 0-19 bags No discount (1) Inyourprogram,definevariableswithmeaningfulnamestoacceptuserinputonordervolume, and calculate total ordering cost based on the order volume inputted. Use if-else statements to handle the calculations for different order volumes as shown in the above table. (2) Yourprogramshouldprintoutuserordervolume,discountrate,andtotalorderingcostinconsole (similar to the following sample outputs)PleasehelpASAP - 30 mins C Program 4. Rich John Ever since John won the lottery, he’s got so many stacks of cash that he can’t count them by hand anymore! He is going to need some help with the counting of his huge wads of cash. Since he is rich now, he figured that he could just pay Cody to make a money counting program for him. Input the number of bills John has then input the values of each bill. Print the sum of all the bills. Input 1. Number of bills 2. Amount of each of the bills Output The first line will contain a message prompt to input the number of bills.The succeeding lines will prompt for the amount of the bills.The last line will contain the sum of the bills. Enter·the·number·of·bills:·4Bill·#1:·100Bill·#2:·200Bill·#3:·500Bill·#4:·1000100·+·200·+·500·+·1000·=·1800
- in C++ : Write a program that, given a number of hours, calculates the number of weeks, days, and hours included inthat number. Write another program that, given the time duration of a task in the number of hours, minutes, and seconds,calculates duration in seconds.6: forLoops.cpp)a) Print the even numbers between 3 and 43.b) Print every third letter starting with 'B'.c) Print the numbers 1 to 20 in one column right next toanother column with the numbers 20 down to 1.d) Print every other character in the computer's characterset.Write this assignment as one program with 4 voidfunctions.2. Write an algorithm (pseudocode) that inputs three positive real numbers x, y, z and outputs the smallest. How would you modify the algorithm in item # 2 above if some or all of the real numbers are allowed to be negative?