The following pseudocode performs some computation. Determine the value of nl after the program ends, if nl = 72, and n2 = 36 at the beginning while nl not equal to n2 if nl > n2 nl = nl - n2 else n2 = n2 - nl end if end while О а. 36 O b. 16 О с. 8 O d. Q
Q: Ahmad and Salim went to a Hypermarket. Ahmad bought number (nl) of T-shirts, each with a price (pl).…
A: Required:
Q: Ahmad and Salim went to a Hypermarket. Ahmad bought number (n1) of T-shirts, each with a price (p1).…
A: Python is a high level programming as well as scripting language. The given program takes user input…
Q: O Looking At College Apartments | It's Gett.. G Grok | Calculate rok Code Gym 1a academy Calculator…
A: I've used the input() function in this example. To collect data from the user. To subtract the…
Q: Write a simple factorial calculator program. The program should perform the following: Step 1. Ask…
A: Given:
Q: A bank charges $10 per month plus the following check fees for a commercial checking account: $.10…
A: A bank charges $10 per month plus the following check fees for a commercial checking account: $.10…
Q: if-else Statements Consider the following if-else statements. Determine the output of the given…
A: Given snippet: int a = 2, b = 9; if (b % a == 0) cout << b << "is even"; else cout…
Q: The following program reads a number, determines whether the number is odd or even, and print the…
A:
Q: Madison County collects property taxes on the assessed value of property, which is 60 percent of its…
A: Madison County collects property taxes on the assessed value of property, which is 60 percent of its…
Q: #include using namespace std; sint main() int x,y,grade; x=88; y=85; x=x+1; y=y+1; cout<<"i am…
A:
Q: Fibonacci Series always starts with 0 and 1, or in other words the first two terms of this series…
A: Algorithm: Step 1: declare two variable first and second Step 2:intizllize first=0 and second =1…
Q: The following pseudocode might be re-written using a(n) structure: if class = "Freshman" then…
A: Answer the above questions are as follows:
Q: by using c++ solve following questions. 1. Write a program that inputs salary and grade, It adds…
A: Here, you need to take input from user for salary and grade. So to store input values, you need to…
Q: 1. Reverse a number (integer) by iterative program. Reverse a number: Input: prompt user to enter an…
A: Note : Since there are multiple questions, according to the guidelines I have done the first…
Q: (1) Prompt the user to input a food item name, price, and quantity. Output an temized lecep Note…
A: Python used to answer this question
Q: An integer n is divisible by 9 if the sum of its digits is divisible by 9. Develop a program to…
A: Given: An integer n is divisible by 9 if the sum of its digits is divisible by 9. Develop a program…
Q: Create a flowchart about this python pseudocode Use computerized flowchart if possible Display…
A: The flowchart about the above python pseudocode. The flow chart can be found in the next step:
Q: I. Problem Statements: Create a VBA program that will compute and display the following: 1. Area of…
A: According to the company's policy, we are allowed to answer only one question at a time. Kindly…
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: Please create the pseudocode for a program that can adding (total) and averaging (AVG) two number (X…
A: Pseudocode is a fake and casual language that helps developer creates calculation, But pseudocode is…
Q: Write a simple factorial calculator program. The program should perform the following: Step 1. Ask…
A: Here I have taken a loop to iterate for 5 times. Inside the loop, I have taken input from the user.…
Q: The simple interest on a loan is calculated by the formula • Interest=principal * rate * days / 365…
A: Since the programming language is not mentioned in the question, we will answer this question in the…
Q: The perimeter P and the AREA of a triangle whose sides have lengths a,b.c are given P= a+b+c and…
A: We are going to write a pseudocode and an actual program to solve the given problem.
Q: 3. The following pseudocode describes a simple algorithm which swaps the values in two variables, x…
A: Required: Please make it clear can you give me how you did it? Trace this sequence using a separate…
Q: Write an algorithm and the pseudocode solving the following
A: Input total food bill calculate tax as 7 percent of total food bill Input percentage of tip as 15 or…
Q: DI Question 28 Assuming the user enters a and b as positive integers. The output of the program is a…
A: In the above code, the operation q = a//b will output the absolute quotient and the operation r =…
Q: Instructions Write a program that calculates and prints the number of minutes in a year. Assume the…
A: Given: Write a program that calculates and prints the number of minutes in a year. The program is…
Q: Ask for a number (0 to end program) then display whether the entered number is odd or even. e.g.…
A: Given Input set for c program Enter a number(0 to end program): 9 Odd Enter a number(0 to end…
Q: Write an algorithm, pseudocode and flowchart for the following problem. 2. To calculate the gross…
A: - Input the Basic salary - if basic salary is greater than 5000 then, Da = 110 % hra = 20 %…
Q: Each question (B1 to B4) carries 4 marks B1 Find the errors in the program and rewrite the correct…
A: Here in code the errors that have is discussed below along with the proper explanation :- In the…
Q: The following flowchart to find the root square of any input number N. drag and drop the correct…
A: Solution:-- 1)As given in the question it is required to complete the following chart as given…
Q: Currently, AOU has 3 British programs: BA, EL and ITC. Assume that students will be admitted to a…
A: Solution:-- 1)The given question has required for the solution which is to be provided in the form…
Q: Ask for a number (0 to end program) then display whether the entered number is odd o even. eg. Enter…
A: As there is no programming language mentioned so question is attempted in python language. start…
Q: Please enter the first number: 128 Please enter the second number: 100 Result: 102 105 188 111 114…
A: NOTE: As per our guidelines I am solving one question for you kindly repost other questions to be…
Q: A five-digit number is entered through the keyboard. Write a program to obtain the reversed number…
A: Since no programming language is mentioned, I am using c++. Code: #include <iostream> using…
Q: What does the following code display if number has the value 36? if(number%2 System.out.print("A");…
A: NOTE: SINCE PROGRAMMING LANGAUGE IS NOT MENTIONED. THEREFORE ANSWERING IN JAVA LANGUAGE. We have…
Q: Find the error(s) in each of the following program segments. Explain how each error can be…
A: printf("%s \n",'Happy Birthday'); correct :- printf("%s \n","Happy Birthday"); printf("%c…
Q: Currently, AOU has 3 British programs: BA, EL and ITC. Assume that students will be admitted to a…
A: PROGRAM INTRODUCTION: Include the required header files. Start the definition of the main function.…
Q: Write a simple factorial calculator program. The program should perform the following: Step 1. Ask…
A: I give the code in java (because you asked in java) along with output screenshot and code…
Q: Prompts the user to enter an integer x. Assume without error checking the user enters a positive…
A: The program is in java 1. importing the scanner class. 2. Creating a variable sc of scanner class.…
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: Please provide an appropriate introduction to the program and then explain the codes n =…
A:
Q: Create a pseudocode that will compute two constant numbers. Display the sum, difference, product,…
A: Given that, Take two constant numbers and compute sum, difference, product and quotient Algorithm:…
Q: a. The payment of part time workers of Mayang Sari Enterprise is based on number of hours worked and…
A: In the given problem, Given the number of hours, we need to calculate the payment.
Q: The factorial of a non-negative integer n, written as n!, is defined as follows: if n>1 if n = 0 (1…
A: program factorialimplicit none integer(kind = 16)::fact integer :: i,n print*,'Enter Number: '…
Q: The following code displays the alphabets only. Complete the Boolean expression. #include #include…
A: You are in the question it is given that the code prints only alphabets in the sample output it…
Q: Ahmad and Salim went to a Hypermarket. Ahmad bought number (n1) of T-shirts, each with a price (p1).…
A: We need to write a program that will take input of the total number of T-shirts (n1), price of…
Q: Ahmad and Salim went to a Hypermarket. Ahmad bought number (nl) of T-shirts, cach with a price (pl).…
A: Algorithm: Start Read n1,p1,n2,p2 Display n1*p1 Display n2*p2 Display n1*p1+n2*p2 Stop
Q: Make a flowchart and pseudocode. Any customer whose total PURCHASE is at least P1000 will be given a…
A: include Header files Declare the variables for purchase, bill and discount Get the purchase amount…
Q: The roots of the quadratic equation ax² + bx + c = 0, a ≠ 0 are given by the following formula:…
A: The term b2 - 4ac is known as the discriminant of a quadratic equation. The discriminant tells the…
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Step by step
Solved in 2 steps with 1 images
- Newton’s law states that the force, F, between two bodies of masses M1 and M2 is given by: F = k 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. cm2/g2. Write the algorithm and a program that prompts the user to input the masses of the bodies and the distance between the bodies. The program then outputs the force between the bodies.C++ please - 24-hour time (also known in the U.S. as military time) is widely used around the world. Time is expressed as hours since midnight. The day starts at 0000, and ends at 2359. Write a program that converts am/pm time to 24-hour time. If the input is 2:30 pm, the output should be 1430. If the input is 12:01 am, the output should be 0001. Hints: Think of how each hour should be handled. 12:00 am -12:59 am becomes what? 8:00 am becomes what? 12:00 pm? 1:00 pm? Group the hours into cases that should be handled similarly (e.g., 1:00 am to 11:00 am are handled the same). Declare variables for hoursAmPm, minAmPm, and hours24. Note that minutes for 24-hour time remain the same as for am/pm, so no extra variable is needed. Use an if-else statement to detect each case, and set the hours24 appropriately. When outputting hour24, check if the hour is 0-9 (just check for < 10). If so, output a "0". So 7 will be output as 07. Do the same when outputting the minutes. #include…The two roots of a quadratic equationax2 + bx + c = 0 can be obtained using the following formula:b2 - 4ac is called the discriminant of the quadratic equation. If it is positive, theequation has two real roots. If it is zero, the equation has one root. If it is negative,the equation has no real roots.Write a program that prompts the user to enter values for a, b, and c and displaysthe result based on the discriminant. If the discriminant is positive, display tworoots. If the discriminant is 0, display one root. Otherwise, display “The equationhas no real roots.”Note you can use Math.pow(x, 0.5) to compute √x. Here are some sampleruns: Enter a, b, c: 1.0 3 1 ↵EnterThe equation has two roots -0.381966 and -2.61803
- The roots of the quadratic equation ax² + bx + c = 0, a ≠ 0 are given by the following formula: In this formula, the term b² - 4ac is called the discriminant. If b² - 4ac = 0, then the equation has a single (repeated) root. If b² - 4ac > 0, the equation has two real roots. If b² - 4ac < 0, the equation has two complex roots. Instructions Write a program that prompts the user to input the value of: a (the coefficient of x²) b (the coefficient of x) c (the constant term) The program then outputs the type of roots of the equation. Furthermore, if b² - 4ac ≥ 0, the program should output the roots of the quadratic equation. (Hint: Use the function pow from the header file cmath to calculate the square root. Chapter 3 explains how the function pow is used.)In Ruritania, fractional numbers are rounded up to the next integer if the fractional part is at least 0.25. However, if they are negative, they are rounded down to the next lower integer if the fractional part is more than 0.75. For example, 2.5 → 32.25 → 32.24 → 2-2.3 → -2-2.76 → -3-3.25 → -3 Complete the following program to print out the integer, using Ruritanian rounding. No loops or if statements.C++ Celsius to Fahrenheit Write a program that converts user input in Celsius to Fahrenheit temperature. The formula is F=95∗C+32 F is the Fahrenheit temperature, and C is the Celsius temperature. Keep one digit of precision.
- // This pseudocode should determine and output the rental fees for cars.// Standard cars rent for $65 per day, compacts rent for $40 per day,// and subcompacts rent for $30 per day. Rentals for at least 7 days// receive a 20% discount. An error message is displayed if the car type// is not valid. start Declarations string carType num days num STD_RATE = 65 num COM_RATE = 40 num SUB_RATE = 30 num DAYS_FOR_DISCOUNT = 10 num DISCOUNT_RATE = 0.20 string QUIT = "ZZZZ" getReady() while carType <> QUIT detailLoop() endwhile finish()stop getReady() output Enter car type or , QUIT, to quit input carTypereturn detailLoop() output "Enter days rented " input days if carType = "Standard" then rate = STD_RATE else if car_Type = "Compact" then rate = COMPACT_RATE else if carType = "Subcompact" then rate = SUB_RATE else rate = 0 output "Invalid car type"…Use the pseudocode description below to write a portion of a program that uses an if, else if, else decision structure that will determine if someone lives in Boston. 1. display message that describes what program will do. 2. ask the user to input an answer to the question: Do you live in Boston?. 3. if they entered 'y', display a message confirming that they live in Boston. 4. if they entered 'n' , display a message confirming that they don't live in Boston. 5. if they entered an invalid entry, display a message telling them.The great circle distance is the distance betweentwo points on the surface of a sphere. Let (x1, y1) and (x2, y2) be the geographicallatitude and longitude of two points. The great circle distance between the twopoints can be computed using the following formula:d = radius X arccos(sin (x1) X sin(x2) + cos(x1) X cos(x2) X cos(y1 - y2))Write a program that prompts the user to enter the latitude and longitude of twopoints on the earth in degrees and displays its great circle distance. The averageradius of the earth is 6,371.01 km. Note you need to convert the degrees into radiansusing the Math.toRadians method since the Java trigonometric methods useradians. The latitude and longitude degrees in the formula are for north and west.Use negative to indicate south and east degrees. Here is a sample run: Enter point 1 (latitude and longitude) in degrees: 39.55 −116.25 ↵EnterEnter point 2 (latitude and longitude) in degrees: 41.5 87.37 ↵EnterThe distance between the two points is…
- The temperature of tin in degrees Fahrenheit is read from input into integer variable temp. If temp is: ≤ 450 degrees Fahrenheit, output "The tin is now a solid." > 450 degrees Fahrenheit and < 4532 degrees Fahrenheit, output "The tin is now a liquid." Otherwise, output "The tin is now a gas." End the output with a newline. Note: Use implicit ranges to simplify the solution. #include <iostream>using namespace std; int main(){ int temp; cin >> temp; /* Your code goes here */ return 0;}Little MAN Computer (LMC) Question: Write a LMC program to determine if a number evenly divides another number. a)If it does not evenly divide then output zero and request two new numbers. b) If it evenly divides two numbers then output quotient and stops the program Please answer with proper LMC code. ThanksSolve it using pseudocode (no python syntax allowed) Code it in Python - must use decision structure and conditional loop Auto Insurance Problem Write a program that prompts the user for his/her age and marital status. Use the following menu for the user to choose marital status: Married Single Then calculate and display a rate for auto insurance using the following rules: Age Married Rate Less than 25 No $800.00 Less than 25 Yes $700.00 Greater than or equal to 25 No $500.00 Greater than or equal to 25 Yes $450.00 Input validation: The user must choose a valid choice from the menu and the user’s age must be at least 16. Use try ... except to make error statements for TypeError and NameError.. ( FOR PYTHON) PLEASE I NEED THE PSEUDOCODE FOR THIS AS WELL