Modify the following program so that it will read in and average four exam scores rather than two: BR main bonus: .EQUATE 5 ;constant exam1: .EQUATE 4 ;local variable #2d exam2: .EQUATE 2 ;local variable #2d score: .EQUATE 0 ;local variable #2d main: SUBSP 6, i ;allocate #exam1 #exam2 #score DECI exam1, s ;cin >> exam1 DECI exam2, s ; >> exam2 LDWA exam1, s ;score = (exam1 ADDA exam2, s ; + exam2) ASRA ; / 2 ADDA bonus, i ; + bonus STWA score, s STRO msg, d ;cout << "score = " DECO score, s ; << score LDBA '\n', i ; << endl STBA 0xFC16, d ADDSP 6,i ; ;deallocate #score #exam2 #exam1 STOP msg: .ASCII "score = \x00" .END please show the screen shot the code and output
Q: Your completed program should: 1. Prompt the user and read in the number of a team playing the…
A: Your completed program should: 1. Prompt the user and read in the number of a team playing the…
Q: write a program in C++ that Mr. Ali has invested an amount of Rs101, 876 in a Bank scheme. Bank…
A: Introduction of the Program: The C++ program calculates the total amount after 7 years using the…
Q: SNAIL-MAIL COMPANY charges Php28.99 per telegram that does not exceed 12 words and Php2.50 pesos for…
A: Program code: #include <stdio.h> int main(){ char name[50]; int word_length;…
Q: An electronic shop wants you to write a program to take orders from the clients and print the…
A: while changing from input type to number to string, make sure you clean the unwanted spaces in the…
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: 5. Write a program that reports whether someone is eligible to run for president in the U.S. You…
A: According to the information given:- We have to follow instruction to create eligibility criteria
Q: An electronic shop wants you to write a program to take orders from the clients and print the…
A: function main: Start read item read price read quantity read delivery type if delivery is fast then…
Q: Write a program that calculates and displays a person's body mass index (BMI). The BMI is often used…
A: Answer in step2
Q: lease write a code which computes the solution of the optimization problem f(x_s)=min f(x) using the…
A: Note: Answering the question in python as no language is mentioned. Input : Function to minimize…
Q: Write a program that initiates the variables cost1, cost2 and costs 3 and assigns them the values…
A: We can easily initiates the variables and assign them values in one go as: (The language here is not…
Q: write a program in c++ Assume eight employees working at Ziomind Sdn Bhd (Ismail, Atikah, Ravi,…
A: C++ code: #include <iostream> #include<iomanip> using namespace std; string names[8];…
Q: A variable in a program is a named placeholder that can contain any integer value. The statement z +…
A: Below is the complete solution with explanation of the given question. The value of each iteration…
Q: A program calculates the total salary of an employee with the condition that if the working hours…
A: Given:
Q: An employee is paid on an hourly basis. Write a C-language program that accepts an employee's ID…
A: #include <stdio.h> int main(){ int id; float rate_per_hour; int num_hours;…
Q: You are working for a lumber company, and your employer would like a program that calculates the…
A: Since programming language is not mentioned in the question, we will answer this question in the C++…
Q: Here's is my C++ program exercise 4-12: Suppose that billingAmount is a double variable, which…
A: Declare and initialize the constant variable creditOnFullBillingPayment with 10.00 Declare and…
Q: A corporation named XYZ needs a program to calculate how much to pay their part-time and full-time…
A: The program code is : - for XYZ company : class Employee: def…
Q: MPUTER PROGRAMMING... Choose all the valid variable names. A. point_2_point B.…
A: Choose all the valid variable names. A. point_2_pointB. wage125C. savings#accountD. _grossE. annual…
Q: Write a program that uses a switch statement as follows: If game contains the letter p , or P the…
A: C++ Program: #include <iostream>using namespace std; // Function print the words Play Station…
Q: In investment analysis,the following equation is frequently used; A=P(1+r/100)n Where n =10 years.…
A: PHP program to find A = P(1+r/100)n
Q: Write a Q. BASIC program that reads and outputs the weather status average using Nested IF…
A: I have implemented the following requirements with comments for better understanding of the code. I…
Q: You are working for a lumber company, and your employer would like a program that calculates the…
A: ********************************************* // iostream in C++ is the standard library which…
Q: You are required to write a program that compute a workers gross pay, the deductions and his/her net…
A: DONE IN C++ PROGRAMM
Q: Write a program that prints a grocery receipt of items purchased. The program must create variables…
A: NOTE : Since the programming language is not defined. So the programming language used here is…
Q: A program that accepts insurance policy data, including a policy number, customer last name,…
A: Answer: I given in the form in hand written
Q: Write a program that reads the marks of a student in the test (te), midterm (mid), assignment…
A: Code: #include<stdio.h> int main(){ int tm,mid,assig,fe,pm; printf("Enter…
Q: This is a MULTIPLE ANSWER question, which means you are able to select one or more answers as being…
A: We need to find correct option(s) regarding given Python code.
Q: Write a program that asks the user to enter the name of the medicine (t for ThroX, f for FeliX), his…
A: Note: Since no programming language is mentioned. I am attempting this in python. if you need it in…
Q: You are working for a lumber company, and your employer would like a program that calculates the…
A: Objective: This program would compute the total cost of woods of different types where the costs for…
Q: You are working for a lumber company, and your employer would like a program that calculates the…
A: Since you are not specifying any language for implementation, I am using C++. Program #include…
Q: A person X wants to distribute the property share to his children and the wife. Write a C+ program…
A: We need to take input from a user of the below things - total property worth in PKR number of sons…
Q: You are working for a lumber company, and your employer would like a program that calculates the…
A: Purpose of the program: This program computes the total cost of different types of lumber for an…
Q: Analyze the following program fragment: int x; double d = 4; switch (d) { case 0: x = 1; case 2: x =…
A: Switch case can be of any valid type that have integral value it can be integer, character but not…
Q: If you are flying with an economy ticket, there is a possibility that you may get upgraded to…
A: A decision table is a graphic representation that describes the logical link ( in understandable…
Q: Write a program that calculates a weekly wage, based on an hourly payrate and how many hours were…
A: Answer:
Q: Write a Python program that plays the rock-paper-scissors game, that following happens: Rock breaks…
A: Code:- # Hello World program in Pythonimport random def game(): computer = random.randint(1,3)…
Q: Write the reading program: basic salary (bsalary) and sales (sales), then calculate and print the…
A: C++ program is given below
Q: 5. Write a program that reports whether someone is eligible to run for president in the U.S. You…
A: According to the information given:- We have to create a program to satisfy the output.
Q: You are working for a lumber company, and your employer would like a program that calculates the…
A: Program Approach: Declare necessary variables in main function. Define float bf method which…
Q: Write a program that will determine the salary of an employee based on his or her rank as follows:…
A: Let's understand step by step : Since programming language is not given so using C++. Now steps…
Q: You are working for a lumber company, and your employer would like a program that calculates the…
A: PROGRAM: //header files for I/O operations #include<iostream> #include <iomanip> using…
Q: e a function called print_hangman() that takes no arguments and prints a hangman corresponding to…
A: We need to implement print_hangman() as given below:
Q: 8. Write a program that will determine the salary of an employee based on his or her rank as…
A: Note: since programming language is not mention , we are providing solution in c++ . please repost…
Q: The New Telephone Company has the following rate structure for long-distance calls: The regular…
A: Solution:
Q: Write a program to determine the equivalent grade of each student in class as follows: a. Read in…
A: Sample output
Q: Write a Q. BASIC program that reads and outputs the weather status average using Nested IF…
A: I have implemented the following requirements with comments for better understanding of the code. I…
Q: In Python using the Pandas Module: Find the Player with the Highest Batting Average from 2019, only…
A: I have created the database of 3 years of player data in CSV naming player.csv.You can use your…
Q: A person X wants to distribute the property share to his children and the wife. Write a C++ program…
A: #include <iostream>using namespace std; int main() { float…
Q: Suppose we add $100 to a checking account in year 1, $200 in year 2, $300 in year 3, and so on. The…
A: #include <iostream>using namespace std; int main(){ double balance = 0; int year = 0;…
Modify the following
BR main
bonus: .EQUATE 5 ;constant
exam1: .EQUATE 4 ;local variable #2d
exam2: .EQUATE 2 ;local variable #2d
score: .EQUATE 0 ;local variable #2d
main: SUBSP 6, i ;allocate #exam1 #exam2 #score
DECI exam1, s ;cin >> exam1
DECI exam2, s ; >> exam2
LDWA exam1, s ;score = (exam1
ADDA exam2, s ; + exam2)
ASRA ; / 2
ADDA bonus, i ; + bonus
STWA score, s
STRO msg, d ;cout << "score = "
DECO score, s ; << score
LDBA '\n', i ; << endl
STBA 0xFC16, d
ADDSP 6,i ; ;deallocate #score #exam2 #exam1
STOP
msg: .ASCII "score = \x00"
.END
please show the screen shot the code and output
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- This program should play the rock-paper-scissors game, which is where the player picks either rock, paper, or scissors, the computer does the same, and then one of the following happens: Rock breaks scissors Paper covers rock Scissors cut paper There is a tie (both players picked the same thing) Fulfillments: Your program should have at least 2 functions, including a main() function (no global variables or global code other than a call to main within an if-statement) You should use at least one multi-way if-statement (using "elif"). You should use at least one logical "and" or "or" in your program You should always output who won (unless there's a tie). Every function (except main) needs to have a comment in a triple-quoted string at the beginning, briefly explaining what it does. Have a repeat function that asks the user if they want to exit the game (ask the user whether he/she wants to continue the game.)Use Python to write a program that play the rock-paper-scissors game, which is where the player picks either rock, paper, or scissors, the computer does the same, and then one of the following happens: Rock breaks scissors Paper covers rock Scissors cut paper There is a tie (both players picked the same thing) Fulfillments: Your program should have at least 2 functions, including a main() function (no global variables or global code other than a call to main within an if-statement) You should use at least one multi-way if-statement (using "elif"). You should use at least one logical "and" or "or" in your program You should always output who won (unless there's a tie). Every function (except main) needs to have a comment in a triple-quoted string at the beginning, briefly explaining what it does. Have a repeat function that asks the user if they want to exit the game (ask the user whether he/she wants to continue the game.)Here's is my C++ program exercise 4-12: Suppose that billingAmount is a double variable, which denotes the amount you need to pay to the department store. If you pay the full amount, you get $10.00 or 1% of the billingAmount, whichever is smaller, as a credit on your next bill; If you pay at least 50% of the billingAmount, the penalty is 5% of the balance; If you pay at least 20% of the billingAmount and less than 50% of the billingAmount, the penalty is 10% of the balance; otherwise the penalty is 20% of the balance. Design an algorithm that prompts the user to enter the billing amount and the desired payment. The algorithm then calculates and outputs the credit or the remaining balance. If the amount is not paid in full, the algorithm should also output the penalty amount. Now here's what I have so far: #include <iostream>#include <iomanip> using namespace std; //declare constant variables //define the main functionint main(){//declare the variablesdouble…
- This assignment is to write a program to score the rock-paper-scissors game. Each of two playersenters R, P, or S. The program than announces the winner as well as the basis for determiningthe winner: "Paper covers rock", "Rock breaks scissors", "Scissors cut paper", or "Draw, nobodywins". Use nested if statements (or if-else-if) to do the homework.In this assignment, you will write two functions, getThrow and checkWinner. Your getThrowfunction will be given an int representing a player number to prompt and will ask that player toenter one of rock, paper, or scissors, repeating until they enter a valid input and returning a charrepresenting the result. Your checkWinner function will be given two chars representing the throwsof the two players and will print the results of the contest. Both functions must accept both upperand lowercase inputs.Your main function will call both functions to form a complete program. Remember that youcan call a function multiple times. Your program will be…What is the output of the program below? (Note: This program works as expected)#*************************************# Final Exam#*************************************pear = 7peach = 8#*************************************# Function: main#*************************************def main(): banana = [1, 2, 3, 4, 5] print(banana, pear, peach, "BEFORE FUNCTION") FinalExamFunction(banana) print(banana, pear, peach, "AFTER FUNCTION")# End of the Main Function#*************************************# Function: FinalExamFunction#*************************************def FinalExamFunction(apple): global pear pear = apple[0] apple[0] = apple[4] apple[4] = pear peach = apple[2] print(apple, pear, peach, "INSIDE FUNCTION")# End of FinalExamFunctionmain()#End of Final Exam ProgramI need the program to print the line "Meal options:" only when there is enough money. def get_possible_meals(budget, num_persons): tacos_cost = 4 empanandas_cost = 3 max_tacos = budget // tacos_cost max_empanadas = budget // empanandas_cost feasible = False print("\nMeal options:") for num_tacos in range (max_empanadas + 1): num_empanadas = (budget - num_tacos * tacos_cost) // empanandas_cost if num_empanadas > 0andnot (num_empanadas + num_tacos) % num_persons: feasible = True total_cost = num_tacos * tacos_cost + num_empanadas * empanandas_cost change = budget - total_cost print(f'${total_cost} buys {num_empanadas} empanadas and {num_tacos} tacos with ${change} change. {(num_empanadas + num_tacos) // num_persons} items per person.') ifnot feasible: print(f'You cannot buy a meal with these options.') def main(): budget = int(input('Enter budget for meal: $')) num_people = int(input('How many people are eating: ')) get_possible_meals(budget, num_people) if __name__ == '__main__':…
- You are working for a lumber company, and your employer would like a program that calculatesthe cost of lumber for an order. The company sells pine, fir, cedar, maple, and oak lumber.Lumber is priced by board feet. One board foot equals one square foot that is one inch thick. Theprice per board foot is given in the following table: (image 1) The lumber is sold in different dimensions (specified in inches of width and height, and feet oflength) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 * 4 * 8 = 64, which whendivided by 12 = 5.333 board feet). An entry from the user will be in the form of a letter and fourinteger numbers. The integers are the number of pieces, width, height, and length. The letter willbe one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When theletter is T, there are no integers following it on the line. The program…Write a menu driven program with the following choice of submenu items:Enter 1 to convert from Celsius to FahrenheitEnter 2 to convert from Fahrenheit to CelsiusSelect 1 or 2:Use a function Celsius which returns Celsius equivalent of a Fahrenheit temperature.C = (5/9)*(F-32)Use a function Fahrenheit which returns Fahrenheit equivalent of a Celsius temperature.F = (9/5)*C + 32Use the functions above to write a program which converts from Celsius to Fahrenheit or fromFahrenheit to Celsius and displays the result. Your program should repeat as long as the user enters 1 or 2 as the choice. Sample run 1: Enter 1 to convert from Celsius to FahrenheitEnter 2 to convert from Fahrenheit to CelsiusSelect 1 or 2: 1Enter temperature in Celsius: 55.00 Celsius = 41.00 FahrenheitEnter 1 to convert from Celsius to FahrenheitEnter 2 to convert from Fahrenheit to CelsiusSelect 1 or 2: 2Enter temperature in Fahrenheit: 3333.00 Fahrenheit = 0.56 CelsiusEnter 1 to convert from Celsius to FahrenheitEnter 2…Implement the following decision table using a nested if statement and multiple alternatives if statement. Assume that the grade point average is within the range 0.0 through 4.0. Do not write entire program. Mention only the required variables and the nested if statement. grade point average transricpt message 0.0-0.99 failed semester - resigister suspended 1.0- 1.99 on probation for next semester 2.0-2.99 (no message) 3.0-3.49 dean's list for semester 3.5-4.00 highest honors for semester
- You are working for a lumber company, and your employer would like a program that calculates the cost of lumber for an order. The company sells pine, fir, cedar, maple, and oak lumber. Lumber is priced by board feet. One board foot equals one square foot that is one inch thick. Theprice per board foot is given in the following table: Pine 0.89Fir 1.09Cedar 2.26 Maple 4.50Oak 3.10 The lumber is sold in different dimensions (specified in inches of width and height, and feet of length) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4 inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 * 4 * 8 = 64, which when divided by 12 = 5.333 board feet). An entry from the user will be in the form of a letter and four integer numbers. The integers are the number of pieces, width, height, and length. The letter will be one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When the letter is T, there are no…The New Telephone Company has the following rate structure for long-distance calls: The regular rate for a call is P8 per minute. Any call started after 6:00P.M. (1800 hours) but before 8:00 A.M (0800 hours) is discounted 50%. Any call longer than 60 minutes receives a 15% discount. All calls are subject to 4% federal tax on the cost after any discounts. Write a program that takes the start time for a call based on a 24-hour clock and the length of the call in minutes. The gross cost (before any discounts or tax) should be displayed followed by the net cost (after discounts are deducted and tax is added).Let's modify the program from this section so that the user can supply the interest rate. For very small interest rates, it may take a very long time for the balance to double. Assume the user can't wait for more than twenty years. Stop adding interest when the balance has doubled or twenty years have elapsed. 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 finaldoubleTARGET=2*INITIAL_BALANCE; doublebalance=INITIAL_BALANCE; intyear=0; Scannerin=newScanner(System.in); System.out.print("Interest rate in percent: "); doublerate=in.nextDouble(); // TODO: Count the years required for the investment to double // but no more than 20 years /* Your code goes here */ System.out.println("Year: "+year); System.out.printf("Balance: %.2f%n", balance); }