Let's Analyze: Laboratory Activity 4 mutt and loop statements Performance Task: Develop a Python program for computing the month-by-month balance in your savings account. You can make one transaction-a deposit or a withdrawal each month. Interest is added to the account at the beginning of each month. The monthly interest rate is the yearly percentage rate divided by 12. Use if and loop statements for this activity. Use the following formula: yearlyRate=0.025 balance = balance+(vearlyRate / 12) * balance
Q: Python Code: Many people keep time using a 24-hour clock (11 is 11 AM and 23 is 11 PM, 0 is…
A: given: Many people keep time using a 24-hour clock (11 is 11 AM and 23 is 11 PM, 0 is midnight). If…
Q: The greatest common divisor, also known as GCD, is the greatest number that will, without a…
A: Answer: Below is the code of GCD:
Q: NOTE--- this is the 2nd time posting this program on here. The first didn't work. Overview…
A: Algorithm and explanation: # Returns the sum of two dice rolls after rolling two six-sided dice.#…
Q: Write a statement that assigns [0, 1, 2, 3, 4] to the variable numbers. python
A: ANS: - numbers = [0,1,2,3,4] Above statement assigns [0, 1, 2, 3, 4] to the variable numbers.
Q: Al-Hadidi hypermarket offers a variety of food, household, electronics, and garments items. They…
A: The problem is based on the calculation of retail price based on the menu system.
Q: ython solution please Task 1 Description let's consider a case when you need a lot of coffee.…
A: Print a statement asking for number of cups. Define variable num and store the number of cups of…
Q: Write the Flowchart and Python code for the following programming problem based on the provided…
A: - We need a flowchart and a code for the average marks calculation. - We are using python here.
Q: A game calculates the average game scores for their players in three attempts. The score in the game…
A: here have to use void function with parameter. i have use attempt as parameter.
Q: In Python with only variables, arithmetic operators, and conditionals (No while, No for, No List)…
A: amt=float(input("Enter the amount:"))amt=amt*100print(int(amt//2000),"twenties")#to find…
Q: 18. Write a program that will display the following pattern, given the value of n. Example: If n =…
A: The Answer is in given below steps
Q: 1.) Multiplication Table (user dependent)
A: C program to print multiplication table using for loop. #include <stdio.h>int main(){ int…
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: An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular…
A: A required Python program is as follows, #Get the hourly wage hour_rate = float(input('Hourly…
Q: Problem: Looping Create a program flowchart that generates and displays the Fibonacci sequence…
A: Java Software called the Java Plug-in is a part of the Java Runtime Environment (JRE). The JRE…
Q: Problem definition: We want to write a Python program forn players, which are playing a toumament.…
A: Required:
Q: A county collects property taxes on the assessed value of property, which is 60 percent of its…
A: The property taxes are collected on the assessed value of the property. The assessed value of the…
Q: Write C# a program that simulates rolling five die. Your program should count the number of rolls it…
A: Use a do-while loop for generating random numbers and generate till all the numbers are same
Q: Stuck on which programming loop to use for this question. 1.) A bug collector collects bugs every…
A: ALGORITHM:- 1. Declare a variable to keep hold of days count & running total. 2. Using while…
Q: In this assignment you will write a computer program from scratch using the Python programming…
A: Code: def add(a,b): return a+b def subtract(a,b): return a-b def multiply (a,b): return a*b def…
Q: Python Programming The trustees of a small college are considering voting a pay raise for their…
A: The trustees of a college want to pay raise of their faculty members. A 7 percent raise for the…
Q: Write (1) the pseudo code, (2) the code, of the following problems: A video club wants to reward…
A: pseudo code: num = ask number of movie rentals refer = ask number of referral made dis =…
Q: In Python Objectives To be able to get input from the user on one line, modify the data type, and…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: This is for Python: Mad Libs are activities that have a person provide various words, which are…
A: GIVEN: Write a python program that gets various words from the user and completes it and prints it…
Q: Al-Hadidi hypermarket offers a variety of food, household, electronics, and garments items. They…
A: Python used to answer this question
Q: Design and write a Python program that gives and grades a math quiz. The quiz will give 2 problems…
A: Code:- import randomscore=0for x in range(2): n = random.randint(1,20) m =…
Q: Linear Program Exercise You need to write a program that solves the following the real-world…
A: We need to solve the given optimization problem using scipy in Python.
Q: Python Programming The trustees of a small college are considering voting a pay raise for their…
A: Steps to execute the given program code: Create a file, “program_7.txt” and enter the given data in…
Q: C program based on the algorithm below Welcome to the temperature conversion program. Please…
A: PROGRAM: //Header files #include <string.h> #include <stdio.h> //Defining the main int…
Q: Solve it using pseudocode (no python syntax allowed) Code it in Python - must use decision structure…
A: Initialize rate variable to store value later: rate=0 Initialize while loop to keep checking for…
Q: discount_.py Al Shams supermarket is a largest shopping center in Oman for electronic items and home…
A: A customer brought an item either from online and offline. If the purchase amount is given then the…
Q: In this assignment you will write a computer program from scratch using the Python programming…
A: Calculator is a tool which is used to perform different operations . Arithmetic operations such as…
Q: in python 3.2 Selling a new vehicle pays a salesperson $1500. Selling a used vehicle pays a…
A: Import local function to use currency formatting in the program.prompt user to enter the type of…
Q: 1.) (PYTHON) Write a game of rock paper scissors, one of the choices will be from the user and the…
A: 1)Code: import random#executes until the loop is truewhile True: user_choice = input("Enter a…
Q: Write a Python program to calculate the revenue from a sale based on the unit price and quantity of…
A: Please find the answer below :
Q: Problem statement in python!! Given a whole number, find the closest perfect square. The distance…
A: Here is the Python code: import mathdef findclosestsquare(num): num_sqrt = math.sqrt(num)…
Q: Create needed variables Input Get the monthly budget Process Get each individual monthly…
A: #asking user to enter budget and amount spentbudget=float(input("Enter your monthly budget: "))…
Q: Raha is a wholesale company for selling furniture. This company would like to change the system to…
A: Sample Output
Q: Average Restaurant Rating and Number of Stars-A restaurant receives numeric scores of 0-10 from five…
A: Python program to solve the given problem is below.
Q: this assignment you will write a computer program from scratch using the Python programming…
A: Code: def add(a,b): return a+b def subtract(a,b): return a-b def multiply (a,b): return a*b def…
Q: A and Bonly In this program, you are asked to write a program in assembly which works as a simple…
A: .data first_int: .asciiz "Please enter first integer: "second_int: .asciiz "Please enter second…
Q: JAVA and Netbeans Using any of the discussed looping statements, create a code that will output the…
A: Program plan: For using the star patterns, the for loop is used to print the symbols This loop is…
Q: The greatest common divisor, also known as GCD, is the greatest number that will, without a…
A: HI, Since you did not mentioned language i used 'C'
Q: An Internet service provider charges customer based on hours used. The rules are: First 100 hours,…
A: Based on python
Q: Average Restaurant Rating and Number of Stars-A restaurant receives numeric scores of 0-10 from five…
A: main(): Input Process Output 5 User ratings - num1[5] Find sum using loop Find average…
Q: Python: Design and implement program that writes out what bills and coins would be dispensed if…
A: The commonly used bills are 1 dollar bill, 5 dollar bill, 10 dollar bill and 20 dollar bill The…
Q: In Python 3.7.4 Write a program that will compute the total cost of an amazon purchase. The program…
A: ProgramSince two questions have been given and it is not clear the answer is sought for which…
Q: Example of Python statement with a "while" loop and decision-making statement.
A: While loop: while loop is used to iterate a block of code until the condition becomes false. Syntax…
Q: please use python. Problem definition: We want to write a Python program for n players, which are…
A: We want to write a Python program for n players, which are playing a tournament. In this…
Q: 16. Write a program that will display the following pattern, given the value of n and m. Example if…
A: Start Take the input as rows and columns Compute the required pattern Using for loop Print the…
Questions are indicated in the image
Step by step
Solved in 4 steps with 2 images
- (Thermodynamics) a. Design, write, compile, and run a program that determines the work,W, performed by a piston engine providing a force of 1000 N over a distance of 15 centimeters. The following formula is used to determine the work performed: W=Fd F is the force provided by the piston in Newtons. d is the distance the piston moves in meters. b. Manually check the values computed by your program. After verifying that your program is working correctly, modify it to determine the work performed by six pistons, each providing a force of 1500 N over a distance of 20 centimeters.4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }(Modify) a. Modify the program you wrote for Exercise 7 to provide the mass of a person as an output, given his or her weight as an input to the program. Use your program to determine the mass of a person who weighs 140 lbf on Earth. b. Modify the program written for Exercise 7a to also output the person’s weight on Mars and the moon. The pull of gravity on Mars is 12.54ft/sec2=3.728m/s2,andonthemoonis5.33ft/sec2=1.625m/s2.
- python solution please Task 1Description let's consider a case when you need a lot of coffee. Maybe you're hosting a party with a lot of guests! In these circumstances, it's better to make preparations in advance.So, we will ask a user to enter the desired amount of coffee, in cups. Given this, you can adjust the program by calculating how much water, coffee, and milk are necessary to make the specified amount of coffee.Of course, all this coffee is not needed right now, so at this stage, the coffee machine doesn't actually make any coffee yet. ObjectivesLet's break the task into several steps:First, read the numbers of coffee drinks from the input.Figure out how much of each ingredient the machine will need. Note that one cup of coffee made on this coffee machine contains 200 ml of water, 50 ml of milk, and 15 g of coffee beans.Output the required ingredient amounts back to the user. ExamplesThe greater-than symbol followed by space (> ) represents the user input. Notice that…Change Return Program: (Write a python program for the following) The user enters a cost and then the amount of money given. The program will figure out the change and the number of twenty-dollar bills, ten-dollar bills, five-dollar bills, single-dollar bills, quarters, dimes, nickels, pennies needed for the change. You must have the maximum amount of higher denominations possible before allowing for lower denominations. For example, If your change is $18.88, You must have One Ten-dollar bill, One Five-dollar bill, Three singles, Three quarters, One dime and three pennies. There should be no nickels; No three Five-dollar bills etc.All programming languages have a loop capability. Looping is the program logic’s ability to repeat one or more lines of code either: A set number of times, a “for loop” (i.e. 10, 100, 500, 763 or more times) An “unknown” number of times (i.e. loop terminates if a tested condition becomes “true” or as long as the tested condition remains “false”), a “while” loop, a “do until” loop, a “do while” loop. This Lab exercise demonstrates the use of the “For Loop”, a standard loop in all programming languages. C++ standard For Loop format looks like: For (n = 1; n <= 100; n++) { Loop line 1 code; Loop line 2 code; Loop line 3 code; Loop line N code; } The loop code needs: A “loop counter variable” (n in the above example) to keep track of how many iterations this loop has run A starting value (i.e. 1 in the above example) A stop test (i.e. run as…
- PYTHON (Do not use functions) Write a program using a Loop structure that takes 5 inputs of sales for item 1 – item 5 from the user during runtime. The program use Running -Total to calculate the sales. The program applies 7% SalesTax The program gives a discount of 5% if the total sales are greater than $6000 The program gives a discount of 6% if the total sales are greater than $7000 The program validates the input as numbers only (Must Enter a Number) Provide different outputs to cover (1-6) The 5 items entered for sales calculations The subtotal of sales without taxes The total sales with taxes The final total of no discount < $6000 The final total of discount if sales > $6000 The final total of discount if sales > $7000C++ Programming Exercise: A real estate office handles, say, 50 apartment units. When the rent is, say, $600 per month, all the units are occupied. However, for each, say, $40 increase in rent, one unit becomes vacant. Moreover, each occupied unit requires an average of $27 per month for maintenance. How many units should be rented to maximize the profit? Write a program that prompts the user to enter: a. The total number of of units. b. The rent to occupy all the units. c. The increase in rent that results in a vacant unit. d. Amount to maintain a rented unit. The program then outputs the number of units to be rented to maximize the profit.please use python. Problem definition:We want to write a Python program for n players, which are playing a tournament. In this competitionplayers solve 5 simple arithmetic problems. The arithmetic problems consist of simple addition operations of the form:number1 + number2 = _where the operands number1 and number2 are randomly generated.Initially your program displays a menu to enter the number of players and the difficulty level as shown in figure 1:Figure 1 Program initial menuThe difficulty level determines the number of digits in the operands number1 and number2:x Easy level means the operands consists of a unique digit (0, 1, 2,..., 9).x Advanced level means the operands consists of two digits (10, 11,…, 99). Use the random number generator to determine number1 and number2. After the playerchooses the difficulty level, your program displays the 5 problems. For instance, the sample below could be given in case where the player chooses advanced level:40 + 90 = _34 + 88 = _23 + 65 =…
- Computer Science Python 3 1) It will need to accept user input (At several different points) 2) Each mathematic operation needs to be it's own function/method: Addition - Takes up to 5 arguments Subtraction - - Takes 3 arguments Multiplication - Takes 4 arguments Division - Takes 2 arguments Log - Takes 1 argument Raise a number to a power ex. X squared Solve Pythagorean theorem Factorial 3) Create the ability for a user to use up to 3 of the aforementioned operations together. Example, I can add 5 numbers making result X. I may then take X, and divide it by 4, generating result Y. That's an example of 2, but you get the idea.using python Write a wholly creative quiz program that consists of three original questions that you make up according to these specifications: One question should require user input of type int One question should require user input of type float One should require a string input The quiz should be scored by using a counter variable that has an initial value of zero and is incremented by one for every correct answer. Provide feedbackto the user for each question, and report the total score when the quiz has finished. Example runs not shown. It's a creative exercise.odify the guessing-game program so that the user thinks of a number that the computer must guess. The computer must make no more than the minimum number of guesses, and it must prevent the user from cheating by entering misleading hints. Use I'm out of guesses, and you cheated and Hooray, I've got it in X tries as your final output. (Hint: Use the math.log function to compute the minimum number of guesses needed after the lower and upper bounds are entered.) this is what I got so far: ============================================ import random import math smaller = int(input("Enter the smaller number: ")) larger = int(input("Enter the larger number: ")) maxattempt = math.ceil(math.log(larger - smaller)) count = 0 while count != maxattempt: count += 1 guess = int((smaller + larger) / 2) print(smaller, larger) print("Your number is: ", guess) hlp = input("Enter =, <, or >: ") if hlp == '>': smaller = guess + 1 elif hlp == '<':…