Suppose num is an int variable, declared and initialized. The value of num is between 2 and 12. Write a C# nested-if-else statement to output • "Game status is WON" if num is 7 or 11 • "Game status is LOST" if num is 2, 3 or 12 "Game status is CONTINUE" if num is 4, 5, 6, 8, 9 or 10
Q: Create a complete C program for lecturers to keep track of students' assessment. • Ask the user for…
A: The switch statement allows us to execute one code block among many alternatives. switch…
Q: Write a C# program named InchesToCentimeters that declares a named constant that holds the number of…
A: 1) inches value given directly using System; namespace InchesToCentimeters{ class MainClass {…
Q: Suppose salary and bonus are variables of type double. Write an if-else statement that displays the…
A: Suppose salary and bonus are variables of type double. Write an if-else statement that displays the…
Q: The if-else if statement A bicycle salesperson was offered a choice of wage plans: a. A straight…
A: Step 1:- Program Approach:- 1.Declare 4 variables of data type double 2.Take the input from the user…
Q: Q2.A senior salesperson is paid $800 a week, and a junior salesperson, $500 a week. Write a C++…
A: A senior salesperson is paid $800 a week, and a junior salesperson, $500 a week. Write a C++ program…
Q: What is the output from the following code segment if the user enters 8
A: According to the question we need to find the output from the following code segment if the user…
Q: Let the following variable is declared in the C++ program as (int X;). Write one statement that…
A: Include the necessary header files. Declare the integer variable X. Get the input from the user. The…
Q: If money is left in a particular bank for more than 5 years, the bank pays interest at a rate 4.5%;…
A: PROGRAM CODE: #include <iostream> using namespace std; int main(){ int numYears,money;…
Q: Write a C++ statement that uses the manipulator setfill to output a line containing 35 stars, as in…
A: Program: #include <iostream>#include <iomanip>using namespace std;int…
Q: In C++ Assume a variable named numberOfPassing Grades and a variable named totalNumberOfGrades have…
A: #include<iostream> using namespace std; int main() // main function { int…
Q: Suppose that beta is an int variable. Consider the following C++ code. cin >> beta;switch…
A: Given program: //include the required header files #include <iostream> #include <math.h>…
Q: Write C++ code for creating a menu driven calculator using if else as well as switch statement and…
A: Solution with detail explanation using cpp comments. // required header file#include…
Q: Create a C++ program that will input name, no of units enrolled, fee per unit and mode of payment.…
A: Hello student Greetings Hope you are doing great Thank You!!!
Q: Write multiple if statements: If car_year is before 1967, print "Probably has few safety features."…
A: Given: Write multiple if statements: If car_year is before 1967, print "Probably has few safety…
Q: Time left 047:29 Write a complete C++ program that prompts the user to enter a string, and prints…
A: start input string using if else print appropriate statement stop
Q: Program for C# Instead of assigning a value to the inches variable, accept the value from the…
A: using System; class HelloWorld { static void Main() { //asking user to enter data in inches…
Q: Write an if...else python statement that determines whether a variable called speed is inside the…
A: In the if statement, we check the condition whether speed is in specified range or not If not in…
Q: Suppose that num is an int variable. Consider the following C++ code. cin >> num;if (num >=…
A: complete code: #include <iostream> #include<cmath> using namespace std; //main method…
Q: Write a multiway if-else statement that classifies the value of an int variable ninto one of the…
A: Program concepts
Q: Let the following variable is declared in the C++ program as (int X;). Write one statement that…
A: cout is the keyword used to print if is the keyword used to check the condition
Q: this is c program Write program that ask the user to enter int mark (0-100) for test Physics. Then…
A: Your C program is given below as you required with an output.
Q: The Kingdom of Aleria uses gold coins and other metals for their money and their exchange rate is as…
A: 1 gold coin is equivalent to 15 silver coins 1 gold coin is equivalent to 25 nickle coins 1 gold…
Q: Write a C# program named InchesToCentimeters that declares a named constant that holds the number of…
A: The Above question is solved in step 2:-
Q: Write a program to calculate electricity bill charged to a consumer. Ask him to enter the units…
A: Input unit consumed by customer in some variable say unit.If unit consumed less or equal to…
Q: A Computer Science instructor at a computer school wants his students to create a program that…
A: #include<iostream> using namespace std; int main(){ double…
Q: Given: double x, y, z; Write a Java statement to assign the minimum of x and y to variable z.
A: Given: WRITE A JAVA Statement TO ASSIGN MINIMUM OF X AND Y TO VARIABLE Z
Q: Write a C# program named ProjectRaises that includes a named constant representing next years…
A: Define modules system and system.console which contains fundamental and base classes and read input…
Q: Create a C++ program that will input a single letter and printout the corresponding digit on the…
A: Sample Response: //C++ program to find the equivalent telephone digit of a…
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: Question: ACE balloon shop sells balloons to customers at 10 Fils each. If the customer buys…
A: Given: Write a C++ program to read no. of balloons to purchase and print the amount of bill in BD.
Q: Suppose num is an int variable, declared and initialized. The value of num is between 2 and 12.…
A: Declare a variable and write down the cases in group wise so that no need to write same print…
Q: Rewrite the following C program using if-else statements. #include int main(void){ int…
A: PROGRAM CODE: #include<stdio.h> // include header file for standard input output int…
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: Make A Flowchart in this C program code. //C program that lists all the prime numbers from 35 to…
A: Answer the above questions are as follows:
Q: Create a complete C program for lecturers to keep track of students assessment • Ask the user for…
A: The switch statement in C programming allows us to execute one code block among many alternatives.…
Q: The Kingdom of Aleria uses gold coins and other metals for their money and their exchange rate is as…
A: Algorithm: Start Read no.of gold coins n Ask user's choice of unit output (S- silver, N-Nickel, C-…
Q: C++ Programming Exercise: Ther are 50 apartment units. When the rent is $600 per month, all the…
A: #include <iostream>using namespace std;#include<fstream>int main (){double rent,…
Q: KEMBOJA Hospital provides top-notched medical care with comfortable rooms. The following are the…
A: “Since you have posted a question with multiple sub-parts, we will solve first three subparts for…
Q: 1. Get three exam grades from the user and compute the average of the grades. Ou average of the…
A: ALGORITHM Start Declare 3 variables- (grade1, grade2 and grade3) of float type Declare another…
Q: Write a C++ program in which you declare variables that will hold an hourly wage, a number of hours…
A: Program Approach: Create variables of type int Take input from user Calculate net pay using formula…
Q: If-else statements: Write a C++ program for an ATM to dispense bills against a requested amount.…
A: PROGRAM CODE: #include <iostream> // include header file for input output…
Q: turbo c++ program of You have a choice of 2 different auto mechanics with different rate…
A: As you have mentioned C++ program of the question, only program is written. The program is written…
Q: Using conditional statements, create a C++ program that will ask the user's height and weight then…
A: Introduction: The formula for BMI is shown below. BMI=Weight in kg(Height in meters)2…
Q: The Drive-Rite Insurance Company provides automobile insurance policies for drivers. Design a…
A: Since this is a multipart question as per guidelines we are allowed to solve only first three sub…
Q: Using C++ Write a program that will receive two integer items from an operator and display to the…
A: Here, first you need to declare 2 variables for two integers, 4 variables for sum, difference,…
Q: Hell’s Kitchen decided to make a TV program that allows the user to enter 2 readings for their…
A: Please refer below for the code and output: Language used is C: #include <stdio.h>int…
c#
Step by step
Solved in 2 steps
- Hell’s Kitchen decided to make a TV program that allows the user to enter 2 readings for their favorite meals, the program will then determine the lower of the 2 readings and displays a message indicating the action to be performed based on this table. 7 or Higher Increase Heat Between 5 and 7, Wait for 5 minutes then increase heat. Between 2 and 5 Wait for 10 minutes then increase heat. 2 or lower Discard Substance Write a C program that will take the input from the user 3 times, by taking the two readings every time, and determining the less of these 2 readings. NOTE: Use “While” Loop.If money is left in a particular bank for more than 5 years, the bank pays interest at a rate 4.5%; otherwise the interest rate is 3.0%. Write a C++ program that uses the cin to accept the number of years in the variable numYears and displays the correct interest rate, depending on the value input into numYears.TASK 03: Write a program that accepts the input code from user and print according to the input code. If the user enters a number 1, then he would go to heaven. If he inputs 2, then the hell was created within his mind and if he prints any other number then his mother earth is waiting for him. Use nested if-else statements. (Write the program in C++ language)
- this is a C++ question, not Python or Java Write a C++ program. A software company sells a package that retails for $109. Quantity discounts are givenaccording to the following table. Quantity Discount 10 - 39 10% 40 - 65 18% 66 - 90 27% 91 - 120 35% 121 – 199 42% 200 or more 48% Write a program using the if/else if/else statement that asks for the number of units soldand computes the total cost of the purchase and the savings due to the discountapplied. The program should also display the number of units purchased and thediscount in percentage. The output should include the following text:Number of units purchased is:Discount applied is:Total savings due to discount is:The total cost of the purchase is:Do NOT use the switch statement, any logical operator or anything that looks likeone in the program. You will not receive credit for the program if you do.In C++, State if the following variable names are valid or invalid. If it's invalid, state why. Note: invalid here means creating a syntax error. a) 1wayTicket b) employee_pay c) #zombies d) R66Y e) STOP! f) Final ExamWrite a flowchart and C code for a program that does the following: Declare variables with integer or float datatypes. Assign the values of three grades (84, 98, 73) to each of the variables Compute the average of the grades – keep the order of operations in mind Display the average using an appropriate message Add a decision that checks to see if the Average grade is greater than 65, if true display a message that the student passed. Be sure to add comments throughout your program describing what is happening Review the output below to check your work. Paste the following three items into a Word document (.docx) Your flowchart in Flowgorithm A screenshot of your code
- Program for C# Instead of assigning a value to the inches variable, accept the value from the user as input. Display the measurement in both inches and centimeters—for example, if inches is input as 3, the output should be: 3 inches is 7.62 centimeters.Q1) How to write a C program segment that prompts and accepts the age and number of hours the customer has spent in the “FUNNY Theme Park”. Then, displays the charges based on the rates shown in Figure 2 below : Age Range Rate ( per hour) (RM)0-20 1.0021-50 3.50Above 50 2.00 In your program, you have to make use of THREE(3) different defined constants for the value of rate per hour and declare the necessary variables.Write a flowchart and C code for a program that does the following: Asks a user the number of years of employment service Uses an else...if statement to display the following messages Service greater than 25 years – You receive a gold watch Service greater than 15 but less than 25 years – You receive a silver pen Service greater than 5 but less than 15 years– You receive an attractive pin Service between 0 and 5 years – You receive a pat on the back Be sure that you are using a logical operator to include all values. Don’t forget to add curly brackets with each condition. Feel free to use logical operators in the conditions - this is not required. Review the output below to check your work. Paste the following three items into a Word document (.docx): Your flowchart in Flowgorithm A screenshot of your code A screenshot of your output (including the Title Bar showing the path and name of your code) into a Word document (.docx) Submit the following three files using the instructions…
- Fahrenheit to Celsius using multiple statements Given a Fahrenheit value temperatureFahrenheit, write a statement that assigns temperatureCelsius with the equivalent Celsius value. While the equation is C = 5/9 * (F - 32), as an exercise use two statements, the first of which is "fractionalMultiplier = 5/9:". Check if varlables temperatureFahrenheit, fractionalMultiplier, and temperatureCelsius exist Variable temperatureCelsius does not exist. From MatlabSuppose that classStanding is a char variable, gpa and dues are double variables. Write a switch expression that assigns the dues as following: If classStanding is 'f', the dues are $150.00; if classStanding is 's', (if gpa is at least 3.75, the dues are $75.00; otherwise dues are 120.00); if classStanding is 'j', (if gpa is at least 3.75, the dues are $50.00; otherwise dues are $100.00); if classStanding is 'n', (if gpa is at least 3.75, the dues are $25.00; otherwise dues are $75.00). (Note that the code 'f' stands for first year students, the code 's' stands for second year students, the code 'j' stands for juniors, and the code 'n' stands for seniors.)Suppose that sale and bonus are double variables. Write an if...else statement that assigns a value to bonus as follows: If sale is greater than $20,000, the value assigned to bonus is 0.10, that is 10%; If sale is greater than $10,000 and less than or equal to $20,000, the value assigned to bonus is 0.05, that is 5%; otherwise the value assigned to bonus is 0, that is 0%.