Write Example: calculate the discount based on input amount using nested if a program, it will input sale amount and else.
Q: Many companies pay time-and-a-half for any hours worked above 40 in a given week. Write a program to…
A: Step 1: Prompt and accept number of hours worked and the pay rate. Step 2: Check whether number of…
Q: Q5:- Write program to calculate the equation sin(x) y(x) = x* where x = 0. 1,0. 2,0. 3,0. 4
A: #include <iostream>#include<cmath>using namespace std;int main(){ float x,y;…
Q: (Find the number of years) Write a program that prompts the user to enter the minutes (e.g., 1…
A: start input minutes calculate number of years and days print it stop
Q: Write a program that reads the subtotal and the gratuity rate, then computes the gratuity and total.…
A: Here I have asked the user to enter subtotal and gratuity rates. Then I have calculated the gratuity…
Q: Write a program to enter a value of x and compute the value of y where x if x ≥0 -x if x < 0 y =
A: #include <stdio.h>int main(){ int x,y; printf("Enter value of x: ");…
Q: program fo read 10 marks, suppose the student reater than or equal 50, and the average greater .If…
A: I have written the code below:
Q: Qi- Write a program to print (very high) if the windspeed is more than 220, or print (high) if…
A: IF/else statement expands the if statement if / else statement if (true / false expression) is…
Q: The general form of (Compound if) is: If (condition); {statmenet1; } else {statmenet1; } * true…
A: A variable holds garbage value when not initialised. C plus plus is case sensitive programming…
Q: If AL=55 , BL=AA Find the result of the following program AND AL,BL OR AL,BL XOR AL,BL
A: Given that, AL = 55H BL = AAH Find the result of AND AL, BL OR AL, BL XOR AL, BL
Q: (Financial application: compute future apartment rent) Suppose that the rent for an apartment is…
A: Need to find each year Amount if Rent(P) = Rs 10000, RateofInterest(R) = 3% Years(t) = 5 Year wise…
Q: Example-3: Write a program to calculate the Area and volume for a sphere. Sol. -The area of sphere 4…
A: The following step calculates the area and volume of a sphere with a given radius r. To find area of…
Q: Software Sales A software company sells a package that retails for $99. Quantity discounts are given…
A: Algorithm: 1. Input unit sold 2. Check if quantity is not negative. 3. Check the condition for…
Q: Q5:- Write program to calculate the equation sin(x) y(x) = x * where x = 0. 1,0. 2,0. 3, 0. 4
A: You have not specified any programming language so, I have used C++ language to write the program.
Q: 15.1 PRACTICE: Branches**: 24-hour time 24-hour time (also known in the U.S. as military time) is…
A: The complete code is given below with output.
Q: Q2-A-Write a program to find y value from the equation y=X2 +5 for X value From 0-10.
A: Note: we are only allowed to solve one question in one post. I am solving the first on here. To get…
Q: A customer in a store is purchasing five items. Write a program that asks for the price of each…
A:
Q: Write a program that reads in loan amount, annual interest rate and number of years for the loan and…
A: Actually, program is an executable software that runs on a computer.
Q: Note: C++ language Write a program that determines the price of an item after discount according to…
A: PROGRAM INTRODUCTION: Include the required header files. Start the definition of the main function.…
Q: In many sports events, contestants are rated by judges with an average score being determined by…
A: PROGRAM INTRODUCTION: Declare and initialize a variable to store the sum of the scores. Start the…
Q: A retail company must file a monthly sales tax report listing the sales for the month and the amount…
A: Question. A retail company must file a monthly sales tax report listing the sales for the month and…
Q: Write the MATLAB program to enter a number and calculate its square root if it is positive or zero…
A: Write the MATLAB program to enter a number and calculate its square root if it is positive or zero…
Q: Q3] ( Write a program to enter a value of x and compute the value of y where x if x ≥ 0 -x if x<0 y
A: In mathematics function is the expression or rule or law which defines the relationship between the…
Q: This program accepts the height of a person in centimeter and categorise the person according * .to…
A: A. 1-ElseIf((p >= 150) And (p < 165)) Then 2-ElseIf((p >= 165) And (p <= 195)) Then…
Q: Nrite a program that takes in a line of text as input, and outputs that line of text in reverse. The…
A: I have answered this question in step 2.
Q: program to read integer number and print equivalent string
A: program to read integer number and print equivalent string
Q: Write the reading program: basic salary (bsalary) and sales (sales), then calculate and print the…
A: Here, first you need to declare some variables for all salaries. Then prompt user to enter basic…
Q: Question Write a python program that takes a sale amount as an input and print the discount…
A: Here I have first of all asked the user for the sale amount and stored it into a variable. Then I…
Q: Q/ Write a program in Matlab language to read the numbers x, y and to calculate the value of z using…
A: It is a simple case of using if else . Given value of x and y. z=(x+y)(2*x+3*y) when x=2, y=3…
Q: 1. Use if - else - elif Write a program to get an integer input from the user. If the input is 25,…
A: The problem is abput finding the area of different shapes corressponding to different inputs from…
Q: The program will receive 2 Input values for the number of hours and minutes that the car has used…
A: here in this program we need to calculate the parking fee. The program will receive 2 Input values…
Q: Complete a program for counting digits and displaying their total count at the end of the program }
A: Complete code: #include <iostream>using namespace std;int main(){int n;int digits = 0;cin…
Q: Q2: If you knew that the signs should be listed as follows: The universal ratio Brand The ratio…
A: As the programming language is not mentioned here, we are using PYTHON The complete code and output…
Q: Write a program that inputs the hourly rate and number of hours worked. Compute and display the…
A: Here I have taken input from the user and then stored it into 2 different variables. Next, I have…
Q: Given the coordinates (x, y) of a center of a circle and its radius, write a program which will…
A:
Q: Write the reading program: basic salary (bsalary) and sales (sales), then calculate and print the…
A: C++ program is given below
Q: Q1) Write a program to enter a number from the keyboard then print "YES" if the number is divisible…
A: Answer : #include <iostream> using namespace std;
Q: One metric ton is approximately 2,205 pounds. Write a program that prompts the user to input the…
A: The below given C++ program will obey the following rubrics: Including necessary header files. In…
Q: Not allowed to use decisions or loops, if then statements, I haven't learned that. I have to use…
A: Since here no programming language is specified. So, we are providing the solution in Java. The…
Q: If cost price and selling price of an item are input through the keyboard, write a program to…
A: I have provided C CODE along with CODE SCREENSHOT and 2 OUTPUT SCREENSHOTS------------
Q: (Find the number of years) Write a program that prompts the user to enter the min- utes (e.g., 1…
A: Code: (Find the number of years) Write a program that prompts the user to enter the min- utes (e.g.,…
Q: Write a program to enter a value of x and compute the value of y where x if x 20 -x if x<0 y=
A: I have provided C CODE along with CODE SCREENSHOT and 2 OUTPUT…
Q: C++ Question Write a program for the user to input for any number and then, the program will…
A: C++ Question Write a program for the user to input for any number and then, the program will…
Q: Assuming the level of the Earth’s oceans continues rising at about 3.1 millimeters per year, write a…
A:
Q: The goal of this program is to input one number consisting of five digits (in one word) from the…
A: import java.util.Scanner; class Digit { // 2. two private members private String digit;…
Q: (Converting a given date to the day number in the year) Write a program that prints the day number…
A: Algorithm: Start Store the number of days of a normal year in a list named regYear and number of…
Q: In Python Write a program that allows the user to type in a phrase and then outputs the acronym…
A: PROGRAM: #Defining the main() def main(): #Getting input from the user phrase =…
Q: Q4. If y=x³-2 Write a program to calculate values of y for every x if x is from 1 to 10
A: Algorithm: Start. Initialize the value of x. y = x^3 - 2. Print the value of y. Exit.
Q: One acre of land is equivalent to 43,560 square feet. Write a program that asks the user to enter…
A: Note: In this question, the coding language is not specified then we are doing this question in the…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Answer correctly this time else directly downvote Find bugs in the givenget_column_choice(): this function will allow us to ask the players which pocket they want to grab stones from. Since we know which row they are grabbing from (since it is not allowed to grab stones from your opponent’s side), we only need to get the column they want. As previously stated, we are using letters to represent the columns to make it easier on the player. This function accepts the current player (should be a 0 or 1), the board, and a list of letters (the same as the list you passed to the print_game_board function) and it will return the index of the column being chosen. The function should ask the player to enter a column letter, then it should check that the conditions listed below hold. If they don’t meet these conditions, it should ask again until it gets a valid letter, otherwise it should return the corresponding column index for that letter. Letter entered must be on the game board. It can be lower case or upper case. (Hint: this doesn’t need to be hard coded,…Only correct answer will be upvoted. Else downvoted.
- Display the following CALCULATION OF VOLUMES [CHOICE] [SHAPE]1 Cuboid2 Sphere3 Cylinder4 ExitEnter your choice-> b. The user has to input the choice. Display the appropriate message when the user enters invalid input. c. Based on the choice entered, get the data required from the user and display the volume of the shape chosen. d. The program will loop again start from step 1. The process will only stop when theuser enters choice 4 (The program will remain to loop if the enter choice is not 4) e. After the program exit from the loop, display the total_volume and average for all the shapes that have been calculated in the program. f. End the program by giving a closing message to the user.I have got wrong answer Please answer write. Would downvote for incorrectDo correct else downvote guarntee.