1- Write a program that converts inches to centimeters. a) Prompt the user to enter a value in inches. I b) Write a set of statements that convert and store the value of inch to cm. The conversion factor is 2.54 cm/inch. c) Write statement that displays the results like below: 17.45 inches = 44.32 centimeters
Q: Convert pounds into kilograms) Write a program that converts pounds into kilo-grams. The program…
A: CODE:- import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: Question: Write program that asks the user to enter car information for 3 cars. The user will read…
A: The problem is based on finding whether a car is due for servicing or not based on mileage and other…
Q: Factorial) The factorial of a nonnegative integer n is written n! (pronounced “n factorial”) and is…
A: C++ code: #include <iostream>using namespace std; int factorial( int n){ int i = 1, final = 1;…
Q: x = 9; y = x++ What are the values of x and y after the two statements execute? X =
A: 1) Initial value of x is 9 2) y is assign value of x using y = x++; x++ is a postfix form, the…
Q: hat will compute the students average • The user will input the following: Name Math …
A: HI, Since the programming language is not mentioned i used python
Q: Exercise #4: Write a program that finds the area of a triangle given the base and the height of a…
A: Below I have provided the answer based on C++ Programming. Refer to the comments for a better…
Q: Exercise 2: Ask for a favorite song, favorite movie, and favorite book. Use print statements to ask…
A: Use scanner class methods to accept input from user and nextLine() method is used to read a string…
Q: A car's miles-per-gallon (MPG) can be calculated with the following formula: MPG = Miles driven /…
A: since there is no programming language is mentioned i have used java for soution Please check the…
Q: Language: Python Write a program that computes and displays the charges for a patient's hospital…
A: Algorithm: Start Read type of patient in-patient or out-patient If in-patient, ask user to enter…
Q: Days of the Week Write a program that asks the user fora number in the range of 1 through 7. The…
A: python code
Q: Write a program that asks the user for an angle, entered in degrees. The program should then display…
A: According to the asked question, the solution is given below with a proper explanation.
Q: Q2) Write a program that prompts the user to input two integers: First Integer and SecondInteger…
A: Step-1: StartStep-2: Declare variables FirstInteger, SecondInteger and take inputs from userStep-3:…
Q: Q1: Identify and correct the errors in each of the following statements: 1. int num=1, sum; //sum…
A: 1. Sum the odd number between 1 to 100 int num= 1; int sum =0; while (num <= 100) {…
Q: 3.Professor Mysterious uses a apecial tormula to calculate the students. Write a program that…
A: I'm writing Python code for this question:
Q: 4. The value of integer variable t is equal to 10 and the value of the variable p is 2. Find the…
A: Answer: t=2,p=2
Q: Write a program in which user is asked to enter two integers (divisor and dividend) and computes the…
A: Program Explanation :- In this Program, the user is required to enter two numbers (separator and…
Q: 33. If the product AB is defined and AB is a zero matrix, then either A or B is a zero matrix.
A: Given: 33. Determine whether the statement are TRUE or FALSE. Write TRUE if the Statement is True…
Q: 12. Find the value of variable z after the execution of the statements given below. int z = 4; z =…
A: Find the value of variable z after the execution of the statements given below. int z = 4; z =…
Q: 54. The determinant of I, equals 1.
A: Answer:-(True)
Q: Determine whether the statement are TRUE or FALSE
A: Let's check the given statement "If the matrix product AB is defined, and either A or B is a zero…
Q: 15. Speed Conversion Chart Your friend Amanda, who lives in the United States, just bought an…
A: Please find the answers to the above questions below:
Q: 1.) Rectangle Area The area of a rectangle is calculated according to the following formula: Area=…
A: program in python user input width and length of rectangle program calculate the area of rectangle…
Q: Q6) Write a program that calculates the factorial of a positive integer, factorial of zero is one.…
A: As the language is not specified answer written in c++
Q: 8. Total Purchase A customer in a store is purchasing five items. The prices of the five items are…
A: Create five variables to store the prices of the five items. Display each item's prices Calculate…
Q: Answer this question Write a program that calculates and displays a person’s body mass index…
A: Here language is not mention so we C language to fulfill the question requirement:…
Q: Q3a) Summary Newton’s law states that the force, F, between two bodies of masses M1 and M2 is given…
A: Note: since programming language is not mentioned we are providing solution in c++. Part a)…
Q: Exercise 4: Selection and loop statements A certain professor gives 5-point quizzes that are graded…
A: As per guidelines we are supposed to answer only one question. Kindly repost other questions as a…
Q: 1- If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of…
A: The C programming language is a computer programming language that was developed to do system…
Q: Assignment: Carefully read the instructions and write a program that reads the following information…
A: The following program is compiled in replit and also Eclipse.Pseudo code:Get the inputs from the…
Q: Computer Fundamentals and Programming 2 Write a program that determines a student’s grade. The…
A: logic:- read three score. Find avg=(a+b+c)/3 use if else to find out avg category. Display grade.…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- 3.Professor Mysterious uses a special formula to calculate the grade of his students. Write a program that repeatedly does the following: a. Prompt the user to enter the grade of the first test b. Prompt the user to enter the grade of the second test . Prompt the user to enter the grade of the third test. The program should then calculate and displays the student grade based on the following formula: grade-.25*testi+.61 test2+.14 test3 NOTE: Exit the program using sentinel or magic value. SAMPLE PROGRAM RUN Enter Test1 (0 to exit): 100 Enter Test2:90 Enter Test3:87 Grade: 92.08 Enter Test1 (0 to exit): 0 Thank you for using this program.Submit your answer in the comment section. Days of the Week Write a program that asks the user for a number in the range of 1 through 7. The program should display the corresponding day of the week, where 1- Monday. 2- Tuesday and so forth. If the user types in a 6 then "Saturday should be printed on the screen. For help with Input statements see: Input Function • The program should print an error message if the user enters a number that is outside the range of 1 through 7. For help with If statements and conditions see the following pages: If-Eke Statements and Operators • Name the source code file yourName HW4_1.py. • Test and run the program. Capture the output console and save it as an image file named yourName Hw3 output4 1jpg. • Submit the py and the image files through Canvas.3. A car's miles-per-gallon (MPG) can be calculated with the following formula: MPG = Miles driven / Gallons of gas used Write a program that asks the user for the number of miles driven and the gallons of gas used. It should calculate the car's miles-per-gallon and display the result on the screen.
- Q3a) Summary Newton’s law states that the force, F, between two bodies of masses M1 and M2 is given by: in which k is the gravitational constant and d is the distance between the bodies. The value of k is approximately 6.67 X 10-8 dyn. cm²/g² . Instructions Write a program that prompts the user to input: The masses of the bodies The distance between the bodies. The program then outputs: The force between the bodies. Your program should be able to work with decimals. Q3b) Cindy uses the services of a brokerage firm to buy and sell stocks. The firm charges 1.5% service charges on the total amount for each transaction, buy or sell. When Cindy sells stocks, she would like to know if she gained or lost on a particular investment. Instructions Write a program that allows Cindy to input: The purchase price of each share The selling price of each share The number of shares sold The program outputs: The total amount invested The total amount received from selling The total service…1- If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of 4.5% of the money; otherwise, the interest rate is 3.0% of the money. Write a program to accept the number of years in the variable numYears and money in the variable money then display the correct interest rate, depending on the value input into numYears 2- Write a program that accepts a user-entered number and calculates the square. Before calculating, check that the number is negative, and isn't zero. If either condition occurs, display a message stating that the operation can't be calculated. 3- Write a program which accept a number of 2 digits and check if ones digit is greater than the tens digit print the number in reverse order, if each of the ones digit and the tens digit greater than 5 print the average of them (ones and tens), otherwise print the message( NOT valid ). 4- Write C++ program to accept a number num (with any number of digits). Then, if the number of digits equal…Exercise 4: Selection and loop statements A certain professor gives 5-point quizzes that are graded on the scale 5-A, 4-B, 3-C, 2-D, 1- F, 0-F. Write a program that accepts a quiz score as an input and prints out the corresponding grade. The input data must be a float numbers and between 0 and 5 Example Input : Quiz score: 3 Output: The grade is C. Exercise 4 Write an improved version of the future value program from Chapter 2. Your program will prompt the user for the amount of the investment, the annualized interest rate, and the number of years of the investment. The program will then output a nicely formatted table that tracks the value of the investment year by year. Your output might look something like this:
- السبت ۲ أكتوبر المحاولة رقم 1 :2 HW • Write a program that computes the average of 5 students grades which are entered by the user. Write a program that converts pounds into kilograms. The program prompts the user to enter a number in pounds, converts it to kilograms, and displays the result. One pound is 0.454 kilograms. محتوى إضافي؟ يمكنك إضافة نص وملفات تدعم إجاباتك. إضافة محتوی إرسال الحفظ لوقت لاحقC-PROGRAM:: Q3Exercise 6: Write a program which prints all the numbers between 10 and 15 which are not multiples/divisible of 3. Hint: use for and if statements
- Q1) Write the pseudocode for the following. a. Ask a user to enter a number. If the number is between 0 and 10, write the word blue.If the number is between 10 and 20, write the word red. If the number is between 20and 30, write the word green. If it is any other number, write that it is not a correctcolour option. b. Ask user to enter weight. Program will only display status “You’re obese” if theweight is more than 100kg. c. Modify above question. Program will display status based on below condition: weight >100kg, status= “Obese” weight < 30kg, status= “Underweight” others, status = “Normal” Q2) Find the complexity of the following codea. for (cnt2 = 0, i = 1; i<=n;i++)for (j = 1; j <= i; j++)cnt2++; b. for (cnt3 = 0, i = 1; i<=n;i*2)for (j = 1; j <= n; j++)cnt3++; c. for (cnt4 = 0, i =1;i<=n;i*=2)for (j = 1; j <= i; j++)cnt4++; d. for (i = 0; i<n;i++)for (j=0;j<n;j++)a[i][j] = b[i][j] + c[i][j]; e. for (i = 0; i<n;i++)for (j = 0; j <j++)for (k…Assignment: Carefully read the instructions and write a program that reads the following information and prints a payroll statement. Employee’s name (e.g., Smith)Number of hours worked in a week (e.g., 10)Hourly pay rate (e.g., 9.75)Federal tax withholding rate (e.g., 20%)State tax withholding rate (e.g., 9%) In summary, design a program to• Prompt user for 5 values and read the values using Scannero Use method .nextLine() to get the String for the nameo Use method .nextDouble() to get all other numeric values• Calculating the Gross payo Gross pay = hours worked * hourly pay rate• Calculating the Federal withholdingo Federal withholding = Gross pay * federal tax withholding rate• Calculating the State withholdingo State withholding = Gross pay * state tax withholding rate• Calculating the Total deductiono Total deduction = Federal withholding + State withholding• Calculating the Net Payo Net Pay = Gross pay – Total deduction• Formatting the output same as the Sample run (Use ONLY…Q1) Write the pseudocode for the following. Ask a user to enter a number. If the number is between 0 and 10, write the word blue. If the number is between 10 and 20, write the word red. If the number is between 20 and 30, write the word green. If it is any other number, write that it is not a correct colour option. b. Ask user to enter weight. Program will only display status "You're obese" if the weight is more than 100kg. c. Modify above question. Program will display status based on below condition: weight >100kg, status= "Obese" weight < 30kg, status= "Underweight" others, status = "Normal"