5. The program snippet is known as follows: a = 10; b = 1; c = 2; do { b = b + 1 while (b <= 10) { if (a%2==0) c = c + b; a = a + 1; } } while (c < = 30); Please make a code generator for the above program fragment.
Q: Introduction This particular program implements a game called "Checkers" that is played in real…
A: #include<iostream.h> #include<stdlib.h> #include<conio.h> #include<stdio.h>…
Q: A retail company assigns a $5000 store bonus if monthly sales are more than $100,000; otherwise a…
A: Introduction: We need to Complete the missing lines in the given Module 2 according to the…
Q: Question # 2 Make a program which can compute the equation given below: 1/4 a, * b+ a, * b + az * b+…
A: Objective: This program computes the result of a given mathematical expression. The program must…
Q: Process conpleted GRADED ACTIVITY #3 (M6.1): SEQUENCE PROBLEM Instruction: Using the sequence…
A: Step 1 Algorithm: 1 Start 2 Read 4 resistors r1,r2,r3,r4 3 Calculate sr=r1+r2+r3+r4 4 Calculate…
Q: Create a C+ Program that will identify the Discount Rate of a shopper based on issued loyalty card,…
A: /* Program that will identify the Discount Rate of a shopper based on issued loyalty card */…
Q: s. A computer shop wants to make a computerized receipt for the purchases made by different…
A: Objective: This program receives purchase details from the user for a shopkeeper. The values of the…
Q: H.W// Write the output of C++ program that appearing on the screen of computer after executing:…
A: Given: #include <iostream.h>#include <conio.h> main() { int x,y; cout<<…
Q: using a C++ program code the problem, The game of "23" is a two-player game that begins with a pile…
A: Hello student, hope you are doing good. This is a console game of human vs computer to be coded in…
Q: Create a C Program that will identity the Discount Rate of a shopper based on issued loyalty card.…
A: Due to guidelines i was unable to answer many questions output- output 2
Q: Create a simple C++ program using struct named Rectangle, which has two data members width and…
A: Input : Define structure in C++. Input width and length of the rectangle Output : Output area of…
Q: plz plz plz .... USING little Man PROGRAM !!!!!!! NOT A programing language (c# , c++ .....) I…
A: the answer is given below:-
Q: Write pseudocode to describe an average mark calculator program that computes the average mark for a…
A: What is Pseudocode: It is a simple version of programming code written in english before it is…
Q: Write a c++ code to print out these requirements, and put a comment and brief description of the…
A: #include <iostream>#include <iomanip>#include <string> using namespace std; int…
Q: 1. This submenu is a very handy tool in monitoring how the variables handled its value while they…
A: Solution of given Question from 1-5 are given their
Q: Direction: Create a simple Java Program that will output the grades of 1 student in different…
A: Find Your Answer Below
Q: Consider the following code segment. It is designed to convert letter grades to grade points.…
A: There is Nothing Wrong with this code segment. Option 2,3 ,4 are False.
Q: Write an OOP in C++ that awards students grades based on the following guidelines; A=70-100;…
A: #include <iostream> using namespace std; int main(){ float marks; cout<<"Enter the…
Q: 1. This submenu is a very handy tool in monitoring how the variables handled its value while they…
A: we need to provide answer for fill in the blanks question
Q: In this assignment you will write a computer program from scratch using the Python programming…
A: Code: def add(a,b): return a+b def subtract(a,b): return a-b def multiply (a,b): return a*b def…
Q: Design by C++ Using subroutines (VOID) write a program to perform numerical integration of…
A: Step 1 The answer is given in the below step
Q: Rebecca Oyewole Project 4 This program calculates a customer receipt # showing each item ordered,…
A: Answer is given below-
Q: Please write a program in just basic for the following question. Run the Tic-tac-toe program in the…
A: Tic-tac-toe program to add two little windows on each side of the "Start Game" button: On the left,…
Q: Design a program to do the administration for a fun run competition. Participants can run a distance…
A: Program:-(in python3)…
Q: code a c++ program, game of 23 The game of "23" is a two-player game that begins with a pile of 23…
A: The program consists of a function logic that is used to decide the move of the computer based on…
Q: In this assignment you will write a computer program from scratch using the Python programming…
A: Calculator is a tool which is used to perform different operations . Arithmetic operations such as…
Q: Write a menu driven C program (not java or python) with the following choice of submenu items: Enter…
A:
Q: 4. Write a complete C++ program to calculate the wages of employees which are based on the number of…
A: we are using do while loop here, since in do while the condition is checked after the execution of…
Q: In Python: A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth…
A: In this code, we are checking that the year entered by user is leap year or not, if the year is leap…
Q: 3. A certain CS professor gives 100-point exams that are graded on the scale 90-100:A, 80–89:B,…
A: Ans: Code: score = int(input("Enter the exam score:"))if score > 90 and score < 100:…
Q: code a c++ program, game of 23 The game of "23" is a two-player game that begins with a pile of…
A: According to the information given:-We have to write c++ code on the basis of instruction mentioned
Q: In C++ language, create a program that gets quarterly sales from a user, and calculates the total of…
A: - We need to code for the sales program.
Q: create a program in c that promts the user to enter a "bank amount" and a "wager amount". If the…
A: Take a variable for the bank amount as input. Take a variable for the wager amount as input. Use a…
Q: Write a program to model a simple calculator. Each data line should consist of the next operation to…
A: Here, we have to implement a calculator that works on following valid operators:- + add- subtract*…
Q: Suppose you shop for rice in two different packages. You would like to write a program of C++ to…
A: The price per unit weight can be calculated by dividing the total package price by total weight and…
Q: complete a prewritten C++ program for a carpenter who creates personalized house signs. The program…
A: #include <iostream>#include <string>using namespace std; main() { string Name; string…
Q: Q # 4. Illustrate your knowledge of C-Programming by implementing a 'Game of Dice'. User will start…
A: PROGRAM CODE: #include <stdio.h>#include <stdlib.h>int menu();int roll_a_dice(); int…
Q: Write a C++ program based on the following requirements: Write a program to calculate an average a…
A: We need to write a C++ program that reads of how many numbers user want to find average, then we ask…
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: e a function called print_hangman() that takes no arguments and prints a hangman corresponding to…
A: We need to implement print_hangman() as given below:
Q: Assignment Write a program in C that converts temperatures between Fahrenheit, Celsius, and Kelvin.…
A: Below is the required code in C language. Program Approach: Including necessary header files for…
Q: A departmental store request to you to automate their cash counter. According to his requirements,…
A: Read the amount that need to paid and then the amount that is given to the cashier. Then subtract…
Q: Apply your knowledge of Computer Programming to solve the following problem: Write a complete…
A: printf("\nEnter Customer Type:\nM for member\nC for card holder\nL for lucky draw winner\nEnter…
Q: 1. a. A technical supplier tests four generators by measuring their output voltages at three…
A: Input : Matrix of voltages and equipment number. Output : Mean voltage of each equipment number.…
Q: In java write a program that takes four int command-line arguments w, x, y, z,. define a boolean…
A: The java program and its approach are given below: - Approach: - Defining the main class and…
Q: Write a Q. BASIC program that reads and outputs the weather status average using Nested IF…
A: I have implemented the following requirements with comments for better understanding of the code. I…
Q: Introduction This particular program implements a game called "Checkers" that is played in real…
A: Given:
Q: 1. a. A technical supplier tests four generators by measuring their output voltages at three…
A: For the given problem :- Input : We will take input as "Matrix of voltages and equipment number".…
Q: on a C++ program and using loops code this problem, The game of "23" is a two-player game that…
A: Here I have created an infinite loop, and then input from the user for the choice to play the game,…
Q: Develop a program that allows the user to enter a start value of 1 to 4, a stop value of 5 to 12 and…
A: Hello student Greetings Hope you are doing great. As you have not mentioned any particular language…
5. The
a = 10;
b = 1;
c = 2;
do {
b = b + 1
while (b <= 10) {
if (a%2==0)
c = c + b;
a = a + 1;
}
} while (c < = 30);
Please make a code generator for the above program fragment.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- You are working for a lumber company, and your employer would like a program that calculates the cost of lumber for an order. The company sells pine, fir, cedar, maple, and oak lumber. Lumber is priced by board feet. One board foot equals one square foot that is one inch thick. Theprice per board foot is given in the following table: Pine 0.89Fir 1.09Cedar 2.26Maple 4.50Oak 3.10 The lumber is sold in different dimensions (specified in inches of width and height, and feet of length) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4 inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 * 4 * 8 = 64, which when divided by 12 = 5.333 board feet). An entry from the user will be in the form of a letter and four integer numbers. The integers are the number of pieces, width, height, and length. The letter will be one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When the letter is T, there are no…You are working for a lumber company, and your employer would like a program that calculates the cost of lumber for an order. The company sells pine, fir, cedar, maple, and oak lumber. Lumber is priced by board feet. One board foot equals one square foot that is one inch thick. Theprice per board foot is given in the following table: Pine 0.89Fir 1.09Cedar 2.26 Maple 4.50Oak 3.10 The lumber is sold in different dimensions (specified in inches of width and height, and feet of length) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4 inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 * 4 * 8 = 64, which when divided by 12 = 5.333 board feet). An entry from the user will be in the form of a letter and four integer numbers. The integers are the number of pieces, width, height, and length. The letter will be one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When the letter is T, there are no…In C++ language, create a program that gets quarterly sales from a user, and calculates the total of all four quarters as well as the average, lowest, and highest quarters. Console Example that should be used/followed when executed The Quarterly Sales program Enter sales for Q1: 12312.57 Enter sales for Q2: 15293.21 Enter sales for Q3: 14920.95 Enter sales for Q4: 23432.21 Total: 65958.94 Average Quarter: 16489.74 Lowest Quarter: 12312.57 Highest Quarter: 23432.21 Specifications: Create the pseudocode needed to implement the solution above. Convert your pseudocode to C++ code including the following specifications: Round the average quarter to a maximum of 2 decimal digits. Use a vector to store the sales for each quarter. Use STL algorithms to process the data for the quarters. Please make sure the average is ROUNDED 2 places to get the output 16489.74 instead of 16489.73
- In c++, create a program that gets quarterly sales from a user and calculates the total of all four quarters as well as the average, lowest, and highest quarters. Console Example The Quarterly Sales program Enter sales for Q1: 12312.57 Enter sales for Q2: 15293.21 Enter sales for Q3: 14920.95 Enter sales for Q4: 23432.21 Total: 65958.94 Average Quarter: 16489.74 Lowest Quarter: 12312.57 Highest Quarter: 23432.21 Specifications to complete program Create the pseudocode needed to implement the solution above. Convert your pseudocode to C++ code including the following specifications: Round the average quarter to a maximum of 2 decimal digits. Use a vector to store the sales for each quarter. Use STL algorithms to process the data for the quarters.When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making periodic payments over a certain period of time. Of course, the lending company will charge interest on the loan. Every periodic payment consists of the interest on the loan and the payment toward the principal amount. To be specific, suppose that you borrow $1,000 at an interest rate of 7.2% per year and the payments are monthly. Suppose that your monthly payment is $25. Now, the interest is 7.2% per year and the payments are monthly, so the interest rate per month is 7.2/12 = 0.6%. The first months interest on $1,000 is 1000 0.006 = 6. Because the payment is $25 and the interest for the first month is $6, the payment toward the principal amount is 25 6 = 19. This means after making the first payment, the loan amount is 1,000 19 = 981. For the second payment, the interest is calculated on $981. So the interest for the second month is 981 0.006 = 5.886, that is, approximately $5.89. This implies that the payment toward the principal is 25 5.89 = 19.11 and the remaining balance after the second payment is 981 19.11 = 961.89. This process is repeated until the loan is paid. Write a program that accepts as input the loan amount, the interest rate per year, and the monthly payment. (Enter the interest rate as a percentage. For example, if the interest rate is 7.2% per year, then enter 7.2.) The program then outputs the number of months it would take to repay the loan. (Note that if the monthly payment is less than the first months interest, then after each payment, the loan amount will increase. In this case, the program must warn the borrower that the monthly payment is too low, and with this monthly payment, the loan amount could not be repaid.)You are tasked with helping a friend with managing a pet storeinventory and sales. Create a program written in C to enter and store aninitial number of cats and dogs in addition to the cost price ofeach. The output of the program should include the number ofcats, price per cat, and price for all cats, and the same goes fordogs. Finally, the output should include the total cost of all pets(cats and dogs) in the store. The following instructions shouldbe helpful:- Create an integer variable named cat- Create an integer variable named dog.- Create a float variable named catp.- Create a float variable named dogp.- Create a float variable named ctotal, dtotal, ptotal.- Prompt the user to enter the number of cats and store it inthe variable cat.- Prompt the user to enter the number of dogs and store itin the variable dog.- Prompt the user to enter the price per cat and store it inthe variable catp.- Prompt the user to enter the price per dog and store it inthe variable dogp.…
- code a c++ program, game of 23 The game of "23" is a two-player game that begins with a pile of 23 toothpicks. Players take turns, withdrawing either 1, 2 or 3 toothpicks at a time. The player to withdraw the last toothpick loses the game. Write a human vs. computer program that plays "23". The human should always move first. When it is the computer's turn it should play according to the following rules: If there are more than 7 toothpicks left, then the computer should withdraw a random number of toothpicks (from 1 to 3). Use the rand() function, as demonstrated in class to produce this number.. If there are 2, 3 or 4 toothpicks left, then the computer should withdraw enough toothpicks to leave 1. If there is 1 toothpick left, then the computer has to take it and loses. When the human player enters the number of toothpicks to withdraw, the program should perform input validation. Make sure that the entered number is between 1 and 3 (inclusive) and that the player is not…code a c++ program, game of 23 The game of "23" is a two-player game that begins with a pile of 23 toothpicks. Players take turns, withdrawing either 1, 2 or 3 toothpicks at a time. The player to withdraw the last toothpick loses the game. Write a human vs. computer program that plays "23". The human should always move first. When it is the computer's turn it should play according to the following rules: If there are more than 7 toothpicks left, then the computer should withdraw a random number of toothpicks (from 1 to 3). Use the rand() function, as demonstrated in class to produce this number.. If there are 2, 3 or 4 toothpicks left, then the computer should withdraw enough toothpicks to leave 1. If there is 1 toothpick left, then the computer has to take it and loses. When the human player enters the number of toothpicks to withdraw, the program should perform input validation. Make sure that the entered number is between 1 and 3 (inclusive) and that the player is not…Write a program that computes the cost of painting and installing carpet in aroom. Assume that the room has one door, two windows, and one bookshelf. Your program must do the following:a. Prompts the user to enter, in feet, the length, width, and height of aroom. Read the dimensions of the room.b. Prompts the user to enter the widths and heights, in feet, of the door,each window, and the bookshelf. Read these quantities.c. Prompts the user to enter the cost, per square foot, of painting thewalls. Read these quantities.d. Prompts the user to enter of cost, per square foot, of installing carpet.Read these quantities.
- I need a Pseudocode for this, please: # Rebecca Oyewole Project 4 This program calculates a customer receipt # showing each item ordered, the quantity,the price per item, the # amount owed for each item, with a total at the end. def get_order(): item = input() if not item: return '00' if item == 'Q': return 'QQ' quantity: int = int(input('How many? ')) return item, quantity register = 0 order = '' prices = 50, 60, 70, 75, 90 print('Welcome to the Lemonade Truck...') print('Ready to take orders!') while 1: print('What would you like to order? (1-3)? One at a time, please.') print('1. Glass of lemonade - $0.50\n' '2. Glass of orange juice - $0.60\n' '3. Glass of grapefruit juice - $0.70\n' '4. Glass of mango juice - $0.75\n' '5. Glass of water - $0.90') item, quantity = get_order() if item == 'Q': break if item == '0': quantities = list(order.count(obj) for obj in '123') for name, quantity…You are working for a lumber company, and your employer would like a program that calculatesthe cost of lumber for an order. The company sells pine, fir, cedar, maple, and oak lumber.Lumber is priced by board feet. One board foot equals one square foot that is one inch thick. Theprice per board foot is given in the following table: (image 1) The lumber is sold in different dimensions (specified in inches of width and height, and feet oflength) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 * 4 * 8 = 64, which whendivided by 12 = 5.333 board feet). An entry from the user will be in the form of a letter and fourinteger numbers. The integers are the number of pieces, width, height, and length. The letter willbe one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When theletter is T, there are no integers following it on the line. The program…Design a program to do the administration for a fun run competition. Participants can run a distance of 5 kilometers, 10 kilometers or 15 kilometers. Ask the user if they wish to register a participant (Y or N). Ask whether the person is a member (Y or N)Ask the distance that the person wishes to run (5, 10, 15). Registration fees for club members are as follows:5km = R 65.0010km = R 100.0015km = R 150.00 Non-members:For the 5 and 10 kilometers distances, the participation fees must be increased by 25%For the 15 kilometer distance the registration fee is double that of club members. Use the given criteria and input information to calculate the registration fee. The program must keep track of the total number of participants per distance category, the total amount received per distance category and total amount received.The program must also calculate the total number of participants and the total number of club members who registered.The program must identify the category with the…