Question 5 What will be printed after executing the following C++ code? int x=60, y=7, z=2; for (int k=10; k>8; k--) { if (z <= 0) { cout << "$$" << x % y ; X -= 2; } else { cout << "$$"<< x / y ; y += 2; } }
Q: Suppose your friend Thomas goes on a business meeting with Elon Musk. He knows that Elon Musk loves…
A: Given in the problem statement that we have to develop a C++ code to find out the amount of time…
Q: Suppose your friend Thomas goes on a business meeting with Elon Musk. He knows that Elon Musk loves…
A: The logic behind the above problem is that the Elon Musk is going to give the 1 minute to those…
Q: Develop a program for current electrical billing system based on the given requirements using the…
A: 1. Flowchart for generating electricity bill
Q: The output printed after executing the following C++ code is Blank 1. int ex=95, ct ; switch (ex %…
A: Switch is a branching statement that takes expression and alters control to matching case.
Q: Suppose your friend Thomas goes on a business meeting with Elon Musk. He knows that Elon Musk loves…
A: C code to perform the given question is given below.
Q: a) Consider the following series, this series will evaluate the value of Y(x) from n = 1 up to…
A: Here I have first of all asked the user to enter the value of x. Now I have checked the value of x…
Q: Suppose your friend Thomas goes on a business meeting with Elon Musk. He knows that Elon Musk loves…
A: Introduction: Given the problem statement, we have to develop a C code to find out the amount of…
Q: You are required to produce a C++ program which solves the following: 1- A worker is paid according…
A: Given that You are required to produce a C++ program which solves the following:1- A worker is paid…
Q: Suppose your friend Thomas goes on a business meeting with Elon Musk. He knows that Elon Musk loves…
A: Introduction: Given the problem statement, we have to develop a C code to find out the amount of…
Q: C++ Programming Problem: William Tucker is a well-known and currently he is cooking a big pizza in…
A: Algorithm: 1. Include the necessary libraries 2. Take input from user 3. Apply the condition using…
Q: You are required to produce a C++ program which solves the following: 1- A worker is paid according…
A: code :-- #include <iostream> using namespace std; int main(){ // variables to store…
Q: Jeff Bezos is appearing in annual Mathematics competition and he is provided with two numbers one is…
A: According to the above listed problem statement we have to develop a C++ code to find the number of…
Q: : Time Machine Your time machine is capable of going forward in time up to 24 hours. The machine is…
A: computeDifference(int pH,int fH,int pM,int fM,boolean pA,boolear fA){ int dH,dT; boolean dA; int…
Q: 3. Marry has planned to do build a wall of height 2m around her rectangular garden. The cost of…
A: The total cost of building complete wall = Area of complete wall * Rate per m2 Area of complete…
Q: 17. Consider the following "C" code segment. At least how many test cases are needed for achieving…
A: Each branch of every possible decision point has to be executed at least once. So let's find the…
Q: Suppose we want to code the following function below. x2 |x| 1 Write an if-else statement below…
A: We need to write R code using If-else to print the values of f(x). where f(x)=
Q: Suppose your friend Thomas goes on a business meeting with Elon Musk. He knows that Elon Musk loves…
A: Algorithm: Loop to generate numbers from the lower to the upper limit. Next, I have counted the…
Q: Write a C++ program Eagle Parts runs a small factory and employs workers who are paid one of three…
A: c++ code: #include <iostream>using namespace std;int main(){ float…
Q: You are asked to write a modular solution (algorithm and C program) that will accept an integer…
A: A C program for the given criteria is as follows, File name: main.c” //Declare header files #include…
Q: Suppose your friend Thomas goes on a business meeting with Elon Musk. He knows that Elon Musk loves…
A: Introduction: Given the problem statement, we have to develop a C++ code to find out the amount of…
Q: Please answer the question in C++ only Given an integer N, let us consider a triangle of numbers of…
A: The procedure to solve the given problem: After taking the required inputs from the user, start with…
Q: ) You are tasked with calculating the cost of PCs for a new computer lab. Write a C++ program to: -…
A: Required: You are tasked with calculating the cost of PCs for a new computer lab. Write a C++program…
Q: You are asked to write a modular solution (algorithm and C program) that will accept an integer…
A: psuedocode: - start MIN_VALUE 5 MAX_VALUE 95 num =0, cents5 = 0, cents10 = 0, cents20 = 0, cents50…
Q: Design by C++ Using subroutines (VOID) write a program to perform numerical integration of…
A: Solution :: Let's see first what is C++ ? Answer :: C++ is a cross-(raised, flat supporting…
Q: Suppose we want to code the following function below. x2 f(x) = { 21x| – 1 |x|>1 |x| < 1 Write an…
A: Input : Value of x. Output : Value of f(x).
Q: 1. Develop a program for current electrical billing system based on the given requirements using the…
A: The above question is about calculating electricity based upon consumption. we will implement…
Q: I have this pracitce problem and I cant figure out how to do the 2-4 sections. IN C++ please... I've…
A: Programming instruction: Create an empty vector and push the values in it. Create required…
Q: C++ Programming Problem: William Tucker is a well-known and currently he is cooking a big pizza in…
A: Given:
Q: 3. When will Friday the 13th occur in 1990? Write a C program that will find all months in 1990 in…
A: Your C program is given below as you required with an output.
Q: WRITE CODE IN C LANGUANGE On their way down the river, Jojo and Lili saw two frogs each in position…
A: In this question, there are input variables which are the position of frog one speed of frog one…
Q: ) You are required to produce a C++ program which solves the following: 1- A worker is paid…
A: Note: “Since you have asked multiple questions, we will solve the first question for you. If you…
Q: Please answer the question in C++ only Given an integer N, let us consider a triangle of numbers of…
A: Algorithm - Take input from user. Now use the below logic - return s.replace(" " + w, "");…
Q: Suppose your friend Thomas goes on a business meeting with Elon Musk. He knows that Elon Musk loves…
A: Introduction: Given the problem statement, we have to develop a C++ code to find out the amount of…
Q: You are required to produce a C++ program which solves the following: 1-A worker is paid according…
A: Code #include <iostream>using namespace std;int main(){ string name; //for input user…
Q: u will show the only Survivor step off Genetic Algorithm -The selected survivors (solutions) will…
A: Write a simple python code where you will show the only Survivor step off Genetic Algorithm -The…
Q: 4. In addition to the °cos' pre-defined function, which is found in the "cmath' library, the cosine…
A: Given: In addition to the "cos pre-defined function, which is found in the 'cmath' library, the…
Q: top of the tank to the surface of the oil. Knowing this distance and the radius of the tank, the…
A: Code: #include <iostream>#include<cmath>using namespace std; int main() {…
Q: You are tasked with calculating the cost of PCs for a new computer lab. Write a C++ program to: -…
A: C++ program to calculate the cost of the PCs for a new computer lab. Prompt the user to enter the…
Q: CHALLENGE ACTIVITY 6.7.2: Function with branch: Popcorn. Define function print_popcorn_time() with…
A: 1)declare function using def keyword 2)use if else ladder to print the output based on user input…
Q: Suppose your friend Thomas goes on a business meeting with Elon Musk. He knows that Elon Musk loves…
A: Introduction: Given the problem statement, we have to develop a C code to find out the amount of…
Q: You are required to produce a C++ program which solves the following: 1- A worker is paid according…
A: PROGRAM CODE: #include <iostream> using namespace std; float calculateTD(float income) {…
Q: A) (let ((x 2) (y 3)) (let ((foo (lambda (z) (+ x y z))) (x 7)) (foo 4))) B) Use COND to implement…
A: A) (let ((x 2) (y 3)) (let ((foo (lambda (z) (+ x y z))) (x 7)) (foo 4))) (let ((x 2) (y 3)) (* x…
Q: Write a C++ program that would solve the problem below (you must use variable declaration and…
A: The area of upper part is l*w The remaining area is l*w+2*w*h+2*h*l
Q: 3. The ABC Lumber Co. asks you to write a Phyton program that would produce a table of g properties…
A: Program description: base is the list that stores the base sizes of lumber. height is the list that…
Q: Suppose your friend Thomas goes on a business meeting with Elon Musk. He knows that Elon Musk loves…
A: According to the given question we have to develop a C code to find out the amount of time that will…
Q: Modify the following C code to get the given output: #include #include #include /* This…
A: Coded using C language.
Q: Please answer the question in C++ only Given an integer N, let us consider a triangle of numbers of…
A: Given an integer N, let us consider a triangle of numbers of N lines in which a number a11 appears…
Q: Using functions, write a C program which does the following; The user enters the height(h) and…
A: Given: Write a c program to find volume of a cylinder and surface area of a cylinder using function.
Q: I need Help again understanding C++ programming with a problem: Assume an equation is in the…
A: EXPLANATION: Given formula is “ax+b=c”, to compute the value of x, formulate the given formula to…
Step by step
Solved in 2 steps
- Given the code below: type point real a, b end type type (point) v read*, v z=v%a/v%b print*, z end What is the equivalent code for the above statements? Question 6 options: none of the given code choices type point real a, b end type type (point), dimension(2):: v read*, v do i=1, 2 z=v(i)%a/v(i)%b end do print*, z end all the given code choices type point real a, b end type type (point), dimension(2):: v read*, v where (i>0) z=v(i)%a/v(i)%b end where print*, z end real va, vb read*, va, vb z=va/vb print*, z endWrite C assignment statements for the following: a. Assign a value of 0 to a variable called between if n is less than -k or greater than +k; otherwise, assign 1. b. Assign a value of 1 to a variable called divisor if digit is a divisor of num; otherwise, assign a value of 0. c. Assign a value of 1 to a variable called lowercase if ch is a lowercase letter; otherwise, assign a value of 0.write a c code for this code While travelling in a train, you observe some college students pulling the alarm chain simply to get down at their desired point. Out of n students m<=n times students pull the chain .You have to print according to the following: 1) If m is >=80 % of n then print strict action is required to restrict this event 2) If m is between 50 to 80 % then print guidelines should be issued 3) If between 10 to 50% then print request to restrict the event 4) If less than 10% then print No action required write flowchart and algorithm for this code.
- i have this c code its a bouncing ball game and it has a paddle to make the ball bounce back but it is not working. how to fix it? #include <stdio.h>#include <stdlib.h>#include <time.h> // Define constants for the screen size and ball velocity.#define SCREEN_WIDTH 60#define SCREEN_HEIGHT 20#define BALL_VELOCITY 1#define CENTER // Variables to keep track of position and speed of ballint x = 0;int y = 100;int x_speed = 5;int y_speed = 5;// Variables to keep track of paddleint x_paddle = 250, y_paddle = 370;int paddle_width_half = 40;// score keepingint score = 0;int width;int key;int LEFT;int RIGHT;int keyPressed;int keyCode; // Called every re-draw, defaul 30 times per secondvoid draw() { // Update position by adding speedx = x + x_speed;y = y + y_speed;if (y < 0)y_speed = -y_speed;if (x > width || x < 0)x_speed = -x_speed; // Check if keys are pressedif (keyPressed) {if (keyCode == RIGHT || key == 'd') {// Move paddle rightx_paddle = x_paddle + 8;}else if…In C++ Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is $4,000; for married people, the standard exemption is $7,000. A person can also put up to 6% of his or her gross income in a pension plan. The tax rates are as follows: If the taxable income is: Between $0 and $15,000, the tax rate is 15%.Between $15,001 and $40,000, the tax is $2,250 plus 25% of the taxable income over $15,000.Over $40,000, the tax is $8,460 plus 35% of the taxable income over $40,000. Prompt the user to enter the following information:Marital statusIf the marital status is “married,” ask for the number of children under the age of 14Gross salary (If the marital status is “married” and both spouses have income, enter the combined salary.)Percentage of gross income contributed to a pension fund Your program must consist of at least the following functions:Function getData: This function asks the user to enter the…Consider the following function: int mystery(int x, int y, int z) { if (x <= y && x <= z && x != 0) return (y + z) / x; else if (y <= z && y <= x && y != 0) return (z + x) / y; else if (z <= x && z <= y && z != 0) return (x + y) / z; else return x + y + z; } What is the output of the following C++ statements? i.cout << mystery(1, 0, 0) << endl; ii.cout << mystery(10, 10, 10) << endl;
- This program should play the rock-paper-scissors game, which is where the player picks either rock, paper, or scissors, the computer does the same, and then one of the following happens: Rock breaks scissors Paper covers rock Scissors cut paper There is a tie (both players picked the same thing) Fulfillments: Your program should have at least 2 functions, including a main() function (no global variables or global code other than a call to main within an if-statement) You should use at least one multi-way if-statement (using "elif"). You should use at least one logical "and" or "or" in your program You should always output who won (unless there's a tie). Every function (except main) needs to have a comment in a triple-quoted string at the beginning, briefly explaining what it does. Have a repeat function that asks the user if they want to exit the game (ask the user whether he/she wants to continue the game.)Modify the craps program to allow wagering inside of C#, and explain each step (reject if you can't). Initialize variable Balance to 1000 dollars. Prompt the player to enter a wager. Check whether the wager is less than or equal to Balance and, if not, have the user reenter the wager until a valid wager is entered. After a valid wager is entered, run one game of craps. If the player wins, increase Balance by wager, and print the new Balance. If the player loses, decrease Balance by wager, print the new Balance, check whether Balance has become zero and, if so, print the message “Sorry. You busted!” (explain steps as much as possible so I can understand plz).The program to modify has the code listed below:// Craps class simulates the dice game craps.using System; class Craps{// create random-number generator for use in method RollDiceprivate static Random randomNumbers = new Random(); // enumeration with constants that represent the game statusprivate enum Status {Continue, Won, Lost}…The volume of oil stored in anunderground 200-foot deep cylindricaltank is determined by measuring thedistance from the top of the tank to thesurface of the oil. Knowing this distanceand the radius of the tank, the volumeof oil in the tank can be determined byusing this formula: volume = It radius2(200 - distance). Use this information towrite a complete C++ program that asksthe user to enter 10 values of radius anddistance measurements, one at a time,and then the program calculates foreach value entered the volume of oil inthe tank Using a for loop. Finally, theprogram should display the all theinputted values and the calculatedvolume in the output screen.
- Use Python to write a program that play the rock-paper-scissors game, which is where the player picks either rock, paper, or scissors, the computer does the same, and then one of the following happens: Rock breaks scissors Paper covers rock Scissors cut paper There is a tie (both players picked the same thing) Fulfillments: Your program should have at least 2 functions, including a main() function (no global variables or global code other than a call to main within an if-statement) You should use at least one multi-way if-statement (using "elif"). You should use at least one logical "and" or "or" in your program You should always output who won (unless there's a tie). Every function (except main) needs to have a comment in a triple-quoted string at the beginning, briefly explaining what it does. Have a repeat function that asks the user if they want to exit the game (ask the user whether he/she wants to continue the game.)The Hotel Inn named as On Time Hotel in which you plan to spend the night tonight offers very interesting rates, as long as you do not arrive too late. Housekeeping finishes preparing rooms by noon, and the sooner guests arrive after noon, the less they have to pay. But if the guest arrives earlier, they would need to wait for noon before they can checked-in. Build a C program that calculates your price to pay based on your guest's time of arrival. Your program will read an integer (0 to 23) indicating the military hour of your arrival. For example, 12 indicates 12 noon arrival, 13 means 1pm arrival, 0 means midnight arrival, etc. The base price is 1000 pesos, and 200 pesos are added for every hour after noon. Thankfully the total is capped at 2000 pesos, so you'll never have to pay more than that. Your program should print the price (an integer) you have to pay, given the input hour of arrival. Additionally, If the client arrives from 6 until 11, then program must ask first whether…Jason Hardy opened a coffee shop at the beach and sells coffee in three sizes: small (9 oz), medium(12 oz), and large (15 oz). The cost of one small cup is $1.75, one medium cup is $1.90, and one largecup is $2.00. Write a menu-driven program in c++ that will make the coffee shop operational. Your programshould allow the user to do the following:a. Buy coffee in any size and in any number of cups.b. At any time show the total number of cups of each size sold.c. At any time show the total amount of coffee sold.d. At any time show the total money made.Your program should consist of at least the following functions:1. a function to show the user how to use the program,2. a function to sell coffee,3. a function to show the number of cups of each size sold,4. a function to show the total amount of coffee sold, and a function to show the totalmoney made.Your program should not use any global variables and special values such as coffee cup sizes and cost of a coffee cup must be declared as…