Write a program that prompts the user to input an integer between 0 and 35. If the number is less than or equal to 9, the program should output the number; otherwise, it should output A for 10, B for 11, C for 12. (Hint: Use the cast operator, static_cast ( ), for numbers >= 10.)
Q: What is the output of the following code? int k=-5; int p 3; while(k<e) { P pik; printf("%d ",p);…
A: The correct option is (a) Given problem contains basic while loop. While Loop in C programming :…
Q: lease complete the following function printBox, which accepts three parameters (i.e., char c, int…
A: Since programming language not mentioned using C++ CODE: #include <iostream>using namespace…
Q: Write a program for The Carefree Resort named ResortPrices that prompts the user to enter the number…
A: C# is a general purpose multi-paradigm programming language developed and used by Microsoft. It…
Q: Write a program that tells what coins to give out for any amount of change from 1 cent to 99 cents.…
A: Program: //Include necessary header files #include <iostream> using namespace std;…
Q: What is output by the code below? if 3 < 2: print("Less Than") else: print("Greater Than")
A: Answer to the above question is in step2.
Q: usiness that uses functions to calculate the weekly payment amounts of employees in a workplace. you…
A: A business that uses functions to calculate the weekly payment amounts of employees in a…
Q: Write a program using C++ language that prompts the user to input an integer between 0 and 35. The…
A: Input a number. IF number < 9 ,print the no. else provide the output acc. to asked in the…
Q: Trace the following code and show all the output from the program. void func1(int); void func2(int =…
A: Given int x = 3, z = 0, y = 2 Step1: func1(y) => func1(2) void func1(int b) { static…
Q: Write a program that asks a user for an integer. Declare a variable num4. Let num4 = x--; Display…
A: Your C++ program is given below as you required with an output.
Q: Write a program which asks for user's age and prints a statement whether the user can vote in US…
A: As programming language is not mentioned, we are providing answer in C++ language.
Q: Write a program that keeps prompting the user to enter the first character of his favorite car; and…
A: The user enters the first alphabet of the car and his/her car’s name get displayed.
Q: The equation of a straight line is written as y = mx + b where m is the slope of the line and b is…
A: The standard types of the situation of a line are: Incline catch structureBlock structureTypical…
Q: Write a program that asks the user to enter the coordinates of 4 points that draw two different…
A: 1)Take input of coordinates for two lines into list 2) calculate slope of two lines 3) based on…
Q: Void Do1 (int: &, a. int &b) { a = 5; a = a + b; b = a + 2; } Int main() {…
A: We have given a C++ code and in which pass variable by reference. Here, integer variable x pass by…
Q: What is wrong in the following code?if score >= 60.0:grade = 'D'elif score >= 70.0:grade =…
A: Define variable score that will take the user input for the score. Use if condition to check if…
Q: What is the output of the following code segment? int x - 10; int y = 7; double z = 4.5; double w =…
A: % gives the remainder Expressions written inside parentheses are evaluated first
Q: Write a c++ Develop a version where the player makes bet. If the Player guesses the first time, the…
A: C++ code to construct a game to guess number by betting money
Q: how do you Write a program that prompts the user to input two POSITIVE numbers — a dividend…
A: PROGRAM STRUCTURE: Include all the required header files. Include iostream for using input output…
Q: Implement a program that reads in a year and outputs the approximate value of a Ferrari 250 GTO in…
A: According to the information given:- We have to follow the table and Implement a program that reads…
Q: C++ Write a program that takes in a line of text as input, and outputs that line of text in…
A: Program approach: Including header files Starting the main function Initializing string variables,…
Q: Write a program that asks the user for three numbers and print the numbers in either ascending or…
A: n1 = float(input("Enter number a: "))n2 = float(input("Enter number b: "))n3 = float(input("Enter…
Q: What will be the value of variable "c", when the following code is int c=0; for (int d = 1; d 3) {…
A: 1) Code and output with explanation: #include <iostream>using namespace std;int main(){ int…
Q: What will be the output when the following code segment is executed? public static void main(String…
A: //here is the output before function call a,b,x,y are 3 2 0 5before function call a,b,x,y are 3 2…
Q: Given int result, int count and the following code snippet 1. count = 1; 2. printf ("At first: count…
A: 1) Above code snippet does various operations with count and result variable. Below are the points…
Q: b- Write a program that allows the user to enter coordinates of circle center and radius then asks…
A: Given: Write a program that allows the user to enter coordinates of circle center and radius then…
Q: What is the value of a, b and c during execution at line 3 in the following code snippet? int a, b,…
A: During execution, at line 3: a=3 b=2 c=1 Explanation: c is incremented by post increment operator…
Q: Find out the final values of a,b and c where following expressions are executed sequentially:[4] int…
A: Here in this question we have given a code fragment.and we have asked to find the final value of a…
Q: What is the output of the following while loop? int x - -5; while (x<0) printf ("4d ",++x) ; a) -5…
A: Below is the required code in C language: #include<stdio.h>int main(){ int x=-5;…
Q: Write a program that asks a user for an integer. Declare a variable num3. Let num3 --x; Display the…
A: The program is written in C++. Check the program screenshot for the correct indentation. Please…
Q: What is the output of the code corresponding to the following code? (a) int X= -5; if (X> 0)…
A: Given X=-5 Condition1: X>0 => -5>0(false) So 1st if block doesn't get executed
Q: Write a program that asks a user for an integer. Declare a variable num1. Let num1 = +x; Display the…
A: num1 = ++x is also written as num1 = x + 1
Q: I have a calculator program that needs to prompt the user to try again if he does not do what the…
A: In the given program code, You are trying to use fail() method, this method is used to check that…
Q: Q: Write a program that will show the following output of the string "Rroduct. Name: HP Laptop…
A: The given program is a simple case of displaying given output. Print statements can be used to…
Q: What is the output of the following code if number is 14, 15, and 30? (a) if number % 2 ==…
A: GIVEN: What is the output of the following code if number is 14, 15, and 30? (a) if number % 2 ==…
Q: 6. If you run the following program, in which order the statements of this program will be executed?…
A: First execute before functions call second execute function calls third execute after function calls…
Q: I need help coding this in python3: CS9 - Leap Year Write a program which reads in a year…
A: Algorithm: read year from input if year%100==0 and year%400==0 then update leap to True else check…
Q: Write a Python console application that prompts the user for a number. The application should return…
A: The asked code for the python program is given in the next step with explanatory comments.
Q: What is the value of q after the following code executes? int a = 4; int c = 4; int q; if (a > c) {…
A:
Q: Programming Challenge (Upload the .cpp file) A long-distance carrier charges the following rates for…
A: Solution : ---- as the requirement specification is given in the problem statement , here is the C++…
Q: Write a program that prompts the user to input an integer between 0 and 35. If the number is less…
A: EXPLANATION: - The program declares int variable num. A prompt is given to user to enter a number…
Q: Write a program that prompts the user to input three positive angle values in degrees to determine…
A: - We need to code for the triangle program.
Q: Write a switch statement that tests the value of the char variable response and performs the…
A: PROGRAM STRUCTURE: Include the required header files. Start the definition of the main function.…
Q: int num1 = 3, num2; cin >> num2; if (num2 > 6) int num1 = 5; cout << num1
A: Please find the answer below :
Q: Your objective is to write to write a complete C++ that Prompt the user and store their inputs in…
A: Data types in C++ programming language: The data types are used to store the type of the values and…
Q: Problem Description Did you know that in lotteries, a 3-digit number with the same numbers in all…
A: Task :- Write a Java program to identify if given number will hit the jackpot or not. Java program…
Q: C# Write a program for The Carefree Resort named ResortPrices that prompts the user to enter the…
A: Algorithm: Start Read enter the number of days for a resort stay n If n==1 or n==2,calculate cost…
Q: What will be the output when the following code segment is executed? public static void main(String…
A: output will be: before function call a, b, x, y are 3 2 0 5 after…
Write a program that prompts the user to input an integer between 0 and 35. If the number is less
than or equal to 9, the program should output the number; otherwise, it should output A for 10, B
for 11, C for 12.
(Hint: Use the cast operator, static_cast<char> ( ), for numbers >= 10.)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images
- Write a program that prompts the user to input an integer between 0 and 35. If the number is less than or equal to 9, the program should output the number; otherwise, it should output A for 10, B for 11, C for 12, . . . , and Z for 35. (Hint: Use the cast operator, static_cast<char>(), for numbers >= 10.)Write a program that prompts the user to enter an integer. If the number is a multiple of 5, print HiFive. If the number is divisible by 2, print HiEven.Write a program that reads a four-digit integer, such as 2014, and then displays it, one digit per line in reverse order, like so: 4 1 0 2 Your prompt should tell the user to enter a four-digit integer. You can then assume that the user follows directions. (Hint: Use the division andm remainder operators.)
- Write a program that prompts the user to enter an integer between1 and 12 and then displays the name of the month that corresponds to the integerentered by the user. For example, if the user enters three, the program shoulddisplay March.Write a program which prompts the user for a number and prints the numbers from 1 up to that number, one per line, and then prints out "That's all!". Some of the code has been provided for you. For example, if the user enters 3 the program should print:Write a program that accepts a number entered by the user and validates if it is odd oreven. If it is even, print a series up to 4 using range() and if it’s odd print a series up to 7.
- Write a program that allows a user to enter any number of student quiz scores, as integers, until the user enters 99. If the score entered is less than 0 or more than 10, display Score must be between 10 and 0 and do not use the score. After all the scores have been entered, display the number of valid scores entered, the highest score, the lowest score, and the arithmetic averageWrite a program that prompts the user to enter an integer from 1 to 15 and displays a pyramid, as shown in the following sample run:Write a program that asks the user to enter two numbers, obtains the two numbers from the user and prints the sum, product, difference, and quotient of the two numbers.
- The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such as a wedding or conference, the hotel offers a special discount as follows: If the number of rooms booked at least 10, the discount is 10%; at least 20, the discount is 20%; and at least 30, the discount is 30%. Also if rooms are booked for at least three days, then there is an additional 5% discount. Write a program that prompts the user to enter the cost of renting one room, the number of rooms booked, the number of days the rooms are booked, and the sales tax (as a percent). The program outputs the cost of renting one room, the discount on each room as a percent, the number of rooms booked, the number of days the rooms are booked, the total cost of the rooms, the sales tax, and the total billing amount. Your program must use appropriate named constants to store special values such as various discounts.Write a program that prompts the user to enter the number of students and each student’s name and score, and finally displays the names of the students with the lowest and secondlowest scores.Write a program that prompts the user to enter the year and first day of the year, then displays the first day of each month in the year. For example, if the user entered the year 2013, and 2 for Tuesday, January 1, 2013, your program should display the following output: January 1, 2013 is Tuesday ... December 1, 2013 is Sunda