Write a complete program that: 1. Prompts the user to enter a letter grade and reads in a letter grade from the keyboard as a char. 2. Uses a switch statement to output the appropriate range for the grade entered in (2). 3. If a letter is entered in (2) that is not a valid letter grade an error should be displayed. This error handling should be done via the default case of your switch statement. Valid letter grades are: A, a, B, b, C, c, D, d, F, and f. Ranges for each letter grade: GRADE RANGE A 90-100 В 80-89.99 C 70-79.99 60-69.99 F 0-59.99
Q: Write a program to read the radian of a circle, check if it is bigger than zero, and if it is to…
A: #include <stdio.h> #define PI 3.14f int main(){float rad,area, perm;printf("Enter radius of…
Q: Write a program that reads in two numbers typed on the keyboard and dividesthe first number by the…
A: Since programming language not mentioned using python.
Q: Write a program that prompts the user to input any digit then swap the position of the first and the…
A: #include <iostream>#include <string.h>using namespace std; int main(){ string number;…
Q: Decryption Key A|B|C| D|E|F|G|H|I|J|K|L|M N|O|P|Q|R|S|T|U|V|W|X|Y|Z (letter above equals below, and…
A: Hence, there is no programming language is mentioned I have solved your question using c++…
Q: Write a program that will continually ask the user to enter a positive number from standard input…
A: Type casting is a feature to convert the type of variable from one datatype to another. There are…
Q: Write the program that does the following: Prompts for and reads in several positive integer…
A: The below given C++ program code will obey the following rubrics: Including necessary header files.…
Q: Write a program that prompts the user to enter the year and thefirst three letters of a month name…
A: Since, here no programming language is specified. So, we are providing the solution in Java. The…
Q: Write a program that keeps accepting words as inputs from user repeatedly until the user enters…
A: Declare empty string variable to hold input word. Initialize both word and vowel word counts as 0.…
Q: Write a program that prompts the user to enter a numeric temperature value that may be a float. A…
A: Please find the answer below
Q: Write a program that prompts the user to enter a numeric temperature value that may be a float. A…
A: Below is the code text so you don't have to type, but make sure to match the text with the image…
Q: Write a program that prompts the user for a positive integer, the first term in a hailstone…
A: C++ used to answer this question
Q: 5. Write a program that reads 3 items, item1, item2, item3, from the keyboard a. if 1 and 2 are the…
A: I give the code as per your requirement along with output and code screenshot in python
Q: The output of the following code snippet is: int main() { char a='P'; printf("Value of a is %c",a);…
A: int main() { char a='P'; printf("Value of a is %c",a); }
Q: Write a program that prompts the user to enter two integer values and prints all numbers between the…
A: The Java code along with the snapshot of code and output is given below:
Q: Write a program that prompts the user to enter a positive integer and obtains its square root in…
A: Given data is shown below:
Q: umber of seconds, displays a message at every
A: Since the programming language is not mentioned, I have done the code using Java.
Q: (b) Write a program that let user to key in two integer numbers and perform calculation by selecting…
A: Please find the answer below :
Q: Write a program that prompt the user for integer until the entered number=0 test an entered number…
A: Basically, user is prompted to enter an integer. If the user wants to stop, he/she can enter 0. For…
Q: Write a program that takes in an integer in the range 20-98 as input. The output is a countdown…
A: 1. 1st digit = number % 10 2. 2nd digit = number / 10 3. If 1st digit is equal to 2nd digit 1.…
Q: Write a program that consists of the code below. a = 1 b = "One" c = 5.2 d = "5.2" e = "3" aa =…
A: Objective: According to the question, we need to rectify some errors and state the reasons for…
Q: Using your code from the previous question, write a program that reads a multi-line message up to…
A: #include <stdio.h>#include <string.h> int main(){ char str[128]; //printf("Enter…
Q: Create a program that performs some calculation of your choice in the try block, in the except…
A: Hello Student. Greetings Hope you are doing great. I will try my best to answer your question. Thank…
Q: Write a program that takes a **string** as input and outputs “Binary Number” if the string contains…
A: The code is written for given problem in Python programming language. Algorithm: The algorithm for…
Q: Write a program that prompts the user to enter an integer number and determines whether it is…
A: Take input from user using Scanner class of java Create 3 if else block Check if number is divisible…
Q: 4) Write a program that reads three numbers and prints "all the same" if they are all the same, "all…
A: CODE:- x = input("Enter the 1st integer ")y = input("Enter the 2nd integer ")z = input("Enter the…
Q: Write a program that reads the integers between1 and 50 and counts the occurrences of each. Assume…
A: Program code: //import the required packages import java.util.Scanner; //Define a class Int_occur…
Q: def aaa(p): return p ** 3 print("more defs". def bbb(q): return q // 16 def ccc(p, q): print(aaa(p))…
A: I have given justication of this code below in detail.
Q: Write a program that takes an integer num between 1 and 99999, then computes the number of digits in…
A: The integer entered by the user is stored in variable n. Then the while loop is iterated until the…
Q: Write a program that reads an integer value from the user rep- resenting a year. The purpose of the…
A: A leap year is denoted as a year in which there are 29 days in the month February and also it comes…
Q: Write a program that reads in two integers and determines and prints if the first is a multiple of…
A: Note: As no programming langauge is mentioned, therefore answering in python language. Input : Two…
Q: Write a program that prompts the user to enter aletter grade A, B, C, D, or F and displays its…
A: Program code: //import the required packages import java.util.Scanner; //define a class public…
Q: Write a program which ends when a user types a user- defined letter. 1. Get an english letter as a…
A: Algorithm: do{ // loop body }while(condition);
Q: Write a program using if else or switch cases only that prompts the user to input three (3)…
A: The program is written in C++. Check the program screenshot for the correct indentation. Please…
Q: Write a program that reads an integer value from the user rep- resenting a year. The purpose of the…
A: As all the parts you have given are different and not related to each other. so I did the 1 part as…
Q: Write a program that prompts the user to enter an integer from 1 to 7 and displays a pyramid, as…
A: Please find the answer below :
Q: Write a program which repeatedly reads numbers until the user enters "done". Once "done" is entered,…
A: As per the question statement, We will run this code and try out different input value and will…
Q: Task 03 Write a program which stores a large number in AX, stores another smaller number in BX. Now…
A: the program is given below:-
Q: Write a program that prompts the user to enter the number of students and each student's name and…
A: Python code to copy:- n = int(input("Enter the number of students: "))name1 = input("Enter a student…
Q: Write a program that reads a positive integer x from the user. If x is even, the program prints all…
A: logic:- declare x do { read positive number if x<0 display error message } while (x<0); if…
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 which repeatedly reads numbers until the user enters "done". Once "done" is entered,…
A: total = 0 count = 0 evens = 0 maximum = None minimum = None while True: num = input('Enter a…
Q: 4. Write a program that will read a date (month, day and year) in integer form and display the date…
A: /*Program to read the date in integer and display the date in standard format using switch…
Q: Implement a program that requests four numbers from the user. Your program should compute the…
A: Programming language is missing in the question. So we will answer this program in Python language.…
Q: Using your code from the previous question, write a program that reads a m
A: Coded using C++.
Q: Write a program that will ask the user to continuously enter a number until such time that the…
A: I have given c++ code below.
Q: Write a complete program that: 1. Prompts the user for a startingNumber and reads the startingNumber…
A: The problem is based on the basics of loops, input and output in C++ programming language.
Q: Given the following code, what initial values for num will cause an error during execution? int…
A: Given:
Q: Write a program which prints the following message exactly in the output screen by using in and \t…
A: The program prints the output format using tab character(\t) and newline character(\n) In a…
Q: Suppose that 1 and y are of type int, z is of type double, and ch is of type char. Consider the…
A: Coded using C++.
Q: Write a program that performs arithmetic division. The program will use two integers, a and b…
A: The C++ program to compute division of two variables a and b. Take input a and b from user…
Write in C++
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
- Write a program that prompts the user to enter a numeric temperature value that may be a float. A second prompt should then ask the user to indicate whether the user wants the entered temperature value converted to degrees Celsius or degrees Fahrenheit by entering either an 'F' or a 'C' for a second prompt. For example, if the user enters 212 at the first prompt and the character C for the second prompt you are to convert 212 degrees F to the Celsius equivalent (which would be 100.0). Converted temperatures should be rounded to 1 decimal place. If the user enters 26 at the first prompt and the character F at the second one, then your programs should convert 26 degrees C to the Fahrenheit equivalent (which is 78.8 deg F)Write a program that takes in an integer in the range 11-100 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. Additionally, output the distance between the starting and ending numbers (ex: 93 - 88 = 5) Note: End with a newline. Ex: If the input is: 93 the output is: 93 92 91 90 89 88 5 Ex: If the input is: 11 the output is: 11 0 Ex: If the input is: 9 or any value not between 11 and 100 (inclusive), the output is: Input must be 11-100 For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits; do not write a large if-else for all possible same-digit numbers (11, 22, 33, …, 99), as that approach would be cumbersome for larger ranges. Hint: To practice incremental development, start by writing code that just outputs the countdown until matching digits and submit to get most of the points. Then, update your code to output the distance.Write a program that prompts the user to enter aletter grade A, B, C, D, or F and displays its corresponding numeric value 4, 3, 2,1, or 0. For other input, display invalid grade. Here is a sample run: Enter a letter grade: B ↵EnterThe numeric value for grade B is 3
- 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 creates a login name for a user, given the user's first name, last name, and a four-digit integer as input. Output the login name, which is made up of the first five letters of the last name, followed by the first letter of the first name, and then the last two digits of the number (use the % operator). If the last name has less than five letters, then use all letters of the last name. Hint: Use the to_string() function to convert numerical data to a string.Write a program that does temperature converter :\n", "- The user will enter if he wants the result in Celsius or in Fahrenheit. Use the input function to read this option. \n", "- Ask the user the value of the temperature he wants to convert. Use the input function to read this value and convert accordingly.\n", "- If the user wants the temperature in Fahrenheit compute: $ Fahrenheit = Celsius*5/9+32$.\n", "- If the user wants the Celsius compute as follows: $ C = (F-32)*5/9 $.\n"
- Write a C++ program that generates a plate number based on the user’s answer to the following questions: 1. What is your favorite color of the rainbow (ROYGBIV)? a. Use the first letter of the chosen color as the first character of the plate number. b. Display “Invalid Input” and ask the user to re-enter his/her answer if the answer is not a valid color of the rainbow. 2. What is your month of birth? a. Use the last letter of the month as the second character of the plate number. b. Display “Invalid Input” and ask the user to re-enter his/her answer if the answer is not a valid month. 3. What is your first name? a. Use the third letter of the first name as the third character of the plate number. No need to include the second name if you have a second name. Make sure to use “cout” and “cin” to collect the necessary inputs from the user. For the number section: 1. Ask the user his/her age and use the age as the first and second digits of the plate…Write a program that consists of the code below.a = 1b = "One"c = 5.2d = "5.2"e = "3"aa = "Number" + abb = "Number" + bcc = "Number" + cdd = "Number" + dee = "Number" + eprint (aa)print (bb)print (cc)print (dd)print (ee)aa = 10 + abb = 10 + bcc = 10 + cdd = 10 + dee = 10 + eprint (aa)print (bb)print (cc)print (dd)print (ee) Run the program.IssuesThis program does not work fully.1. Describe the error.2. What do they depend on?Solve the problems, but you have some limitations.You may only change what is assigned to aa, bb, cc, dd and ee.2. As far as possible, the calculations should work. (10+ "One" does not work, of course.)If you later change the values (but not type) of the assignments to a, b, c, d and e, the program should still work as expected.This is the question - Write a program that inserts parentheses, a space, and a dash into a string of 10 user-entered numbers to format it as a phone number. For example, 5153458912 becomes (515) 345-8912. If the user does not enter exactly 10 digits, display an error message. Continue to accept user input until the user enters 999. This is the code I have - However it isn't seeming to accept my output. It doesn't like what I have for some reason - import java.util.*; public class PhoneNumberFormat { public static void main(String[] args) { // Write your code here //Create an instance of Scanner class Scanner keyboard=new Scanner(System.in); //declare string data type variables String phoneNumber= ""; String formattedPhoneNumber=""; /*Run the loop infinitely until user enters 999 to exit from program*/ while(true) { System.out.println("Enter phone number: "); phoneNumber=keyboard.nextLine(); //exit…
- Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. Ex: If the input is 93, the output is: 93 92 91 90 89 88 Ex: If the input is 77, the output is: 77 Ex: If the input is not between 20 and 98 (inclusive), the output is: Input must be 20-98 For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits; do not write a large if-else for all possible same-digit numbers (11, 22, 33, ..., 88), as that approach would be cumbersome for large ranges.make this into a problem: Here we have implemented the program that displays whether the user input B is greater / smaller than A .When the user input A is greater than B then the output is " B is smaller than A "else the output is "B is greater than A". like this: Write a program that accepts an integer from the user. If the integer is an even number, display “EVEN”; else display “ODD”.In C++, write a program that checks whether there are duplicated numbers within three user inputted numbers, and return if "all the numbers are distinct", "all numbers are the same", or if "there are two are duplicated numbers."