Complete the expression so that user_points is assigned with 0 if user_items is less than 30 (second branch). Otherwise, user_points is assigned with 10 (first branch). user_items = int(input()) # Program will be tested with values: 15, 20, 25, 30, 35. if ''' Your code goes here ''': user_points=10 else: user_points=0 print(user_points)
Q: In the game of BizzBuzz, players generally sit in a circle. The player designated to go first says…
A:
Q: Write a program for grade computation. The final grade should be computed using the formula:…
A: C program: C is a general purpose programming language developed by Dennis Ritchie in 1972. C is a…
Q: Write a program that determines a student grade's given his/her final score. Use the following table…
A: According to the Question below the Solution: Output:
Q: Sales are paid based on an annual salary rather than an hourly wage. However, some employees are…
A: Here we take a simple ipo chart for this problem. ================================= Keep in mind…
Q: If the input is negative, make numItemsPointer be null. Otherwise, make numItemsPointer point to…
A: If the input is negative, make numItemsPointer be null. Otherwise, make numItemsPointer point to…
Q: The power of the microwave can be calculated as follows: Power=Work/Time Work is measured in joules…
A: code: #include<iostream> using namespace std; //main method int main() { //variable…
Q: Write a program called CashRegister.cpp. The program should prompt the user for each item they are…
A: Create two seperate vector one store item price and second one atore item list. Don't write full…
Q: Positions on a chess board are identified by a letter and a number. The letter identifies the…
A: The chessboard is a game board where two players move the pawns on the board of size 8x8. The…
Q: Build a program to input student grade by Text1 and print (A or B or C) by the following conditions:…
A: Dim x as integerPrivate sub command1_click()x= val (text1.text)If x<= 100 And x>=80 then…
Q: A factorial of N is defined as 1 if N is O or 1, and 1*2**N if N is a non-negative integer. Write a…
A: note:- only one program will be solved if they are not linked . Also mention programming language…
Q: A programmer wants to determine whether a score is within 10 points of a given target. For example,…
A: Answer is option D (target-10 ≤ score) AND (score ≤ target +10 )
Q: Implement the following decision table using a nested if statement and multiple alternatives if…
A: When the grade point average value lies between 1.0-1.99 (inclusive both the values) or not. If yes…
Q: Question: Write A Program That Compares The Values Of Y1 And Y2 In.. 3. ( Write a program that…
A: Given:
Q: ACTIVITY 1.3: Age Equivalent Write an algorithm and draw a flowchart that reads the age of a…
A: ALGORITHM: - Start;Declare variable age;input age of person;if(age <0) { Print "error, age is…
Q: CHALLENGE 1.2.3: Read multiple user inputs. ACTIVITY Write two cin statements to get input values…
A: #include <iostream> using namespace std; int main(){ int birthMonth; int birthYear;…
Q: Write a program that determines a student's grade. The program will read three types of scores…
A: The program is written in C++ Language. Check the program screenshot for the correct indentation.…
Q: Display basic salary, bonus and net salary
A: EXPLANATION--> Firstly input two variable named with salary and grade If grade is greater then…
Q: The program below simulates tossing a fair coin N times. The program computes the longest sequence…
A: Let's see step by step: 1. const int HEADS = 0; const int TAILS = 1; here HEADS is initialized…
Q: To find the total marks of a student in an assignment, we need to get the proposal marks, Task 2,…
A: Here I am providing the code and the output for the given problem
Q: An anagram is a word or a phrase formed by rearranging the letters of another phrase such as "ITEM"…
A: As per the given question, we are given two phrases and we have to check if they are anagrams of…
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: Task 2: Find the terms of any linear sequence given by the rule Term = a*n + b, where a and b are…
A: psedocode:- declare an int n,a,b,arr[100],sum=0,count=0 display "enter value of n: " read n…
Q: Complete the pay computation to give the employee 1.5 times the hourly rate for hours worked above…
A: Python code: hours = 45 rate = 10 overtimeRate = 1.5 grossPay = 0 if hours < 40: grossPay =…
Q: A contractor orders, say, 30 cubic yards of premixed concrete to construct a patio that is to be,…
A: C++ Code for the given Question #include<bits/stdc++.h>#include <iostream> using…
Q: STARBUCKS COFFEE offers a loyalty rewards program for customers with two levels: Green and Gold. It…
A:
Q: // This pseudocode is intended to determine whether students have // passed or failed a course;…
A: Flow chart-A flowchart is a picture of the separate steps of a process in sequential order.…
Q: Suppose Dave drops a watermelon off a high bridge and lets it fall until it hits the water. If we…
A: Given, d=0.5×g×t2 g=9.8 meters/second2 Program description: t is the user input integer variable…
Q: Assuming the following code, what will the value of x be after the code is executed: x = 20 if x %…
A: Here initially x=20 if x % 2 == 0: As x is divisible by 2, x%2 = 20%2 return 0, thus this…
Q: This program accepts the height of a person in centimeter and categorise the person according to…
A: We are providing both incorrect and correct options explanation.
Q: Question 1 Write a program that asks the user to enter the number of passengers in an airplane and…
A: "Since you have not mention any programming language, so will write our program in C language." C…
Q: Complete the program shown in the 'Answer' box below by filling in the blank so that the program…
A: Initially y=[] an empty list. For Loop: First Iteration: i=0 and len(x) must be 4 because we are…
Q: Given the following: Group A (Kabelo 40, Karabo 67) Group B (Lufhuno 30, Thembi 25) Group C…
A: 1. For the 3 groups A, B and C initialize 3 separate maps with the key-value pairs of students and…
Q: A company want to raise the salary of its employee. The raise rate is given as following: • The…
A: THIS IS A MULTIPLE QUESTION BASED PROBLEM. ONLY FIRST QUESTION IS ANSWERED. KINDLY SEND THE…
Q: Using Java programming language write a program to manage a hotel with 24 rooms; 10 rooms are…
A: It is defined as
Q: Complete the following program that finds which of the time points comes first. The time is…
A: (1 ) here time2 comes first means hh1 > hh2 because as hh2 is come first it will must be less…
Q: Task 1: Find the even multiples of any number chosen by the user in a given range - the user should…
A: The solution to the given problem is below.
Q: Jump to level1 Write multiple if statements: If car_year is before 1967, print "Probably has few…
A: NOTE: Since programming, langauge is not mentioned. Therefore answering questions in Python…
Q: A student took four quizzes in a term and would like to compute their average. He also would like to…
A: 1. Input marks of 4 quiz 2. Add the marks of 4 quiz to get the total(tot) 3. Divide the add value…
Q: 1. Write a simple program to determine the credit card types according to annual income and user…
A: #include <iostream> using namespace std; int main(){ int inc,interest;…
Q: was isBonus(). Since there are two types of bonuses now, rename this module and the module call to…
A: Pseudocode is a plain English representation of the stages of an algorithm or another system in…
Q: 1. A 10% discount is applied to purchases over $10.00. Write a program that asks for amount…
A: The program is created as follows: Declare variables for purchase amount, discount and discounted…
Q: Complete the following program that finds which of the time points comes first. The time is…
A: (1 ) in if condition it will print that time1 comes first means hours of time1 must be less then…
Q: // This program gets student names continuously until XXX is entered. Then, for each student, quiz…
A: All the return boxes should be connected under one box.
Q: Q3: Write the algorithm for a program that calculates the cost of the phone bill according to the…
A: The algorithm is shown below. Algorithm PhoneBill(minutes) //Algorithm to find teh total…
Q: e. No Yes B? G No D H? Yes Yes E? D D. No F Yes E? D No
A: PSEUDOCODE -> 1. First, create a if condition if , If condition B is TRUE- G…
Q: Q4. Write an algorithm and draw a flow chart to get cgpa of student. If CGPA is more than equal to…
A: Algorithm: Step 1: StartStep 2: Read the CGPAStep 3: if CGPA >= 2.7 then go to step 4 . else go…
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 contractor orders, say, 30 cubic yards of premixed concrete to construct a patio that is to be,…
A: Given The answer is given below.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such as a wedding or conference, the hotel offers a special discount as follows: If the number of rooms booked at least 10, the discount is 10%; at least 20, the discount is 20%; and at least 30, the discount is 30%. Also if rooms are booked for at least three days, then there is an additional 5% discount. Write a program that prompts the user to enter the cost of renting one room, the number of rooms booked, the number of days the rooms are booked, and the sales tax (as a percent). The program outputs the cost of renting one room, the discount on each room as a percent, the number of rooms booked, the number of days the rooms are booked, the total cost of the rooms, the sales tax, and the total billing amount. Your program must use appropriate named constants to store special values such as various discounts.(Statistics) This is the formula for the standard normal deviate, z, used in statistical applications: z=(X)/ X is a single value. refers to an average value. refers to a standard deviation. Using this formula, you need to write a program that calculates and displays the value of the standard normal deviate when X=85.3,=80,and=4. a. For this programming problem, how many outputs are required? b. How many inputs does this problem have? c. Determine a formula for converting input items into output items. d. Test the formula written for Exercise 7c, using the data given in the problem.Write a program that computes how much a customer has to pay after purchasing two items. Make the lower-priced item half price. If the two items have identical prices, you can make one or the other half price. The price is calculated according to the following rules:• Buy one get one half off promotion: the lower price item is half price.• If the customer is club card member, additional 10% off.• Tax is added. Inputs to the program include:• Two items’ prices• Have club card or not (User enters ‘Y’ or ‘y’ for “yes”; ‘N’ or ‘n’ for “no”)• Tax rate (User enters the percentage as a number; for example, they enter8.25 if the tax rate is 8.25%) Program displays:• Base price - the price before the discounts and taxes• Price after discounts - the price after the buy one get one half off promotionand the member’s discount, if applicable• Total price – the amount of money the customer has to pay (after tax)printed with the precision of 2 decimal digits. Hint: In order to print a number in a…
- // This program gets student names continuously until XXX is entered. Then, for each student, quiz scores are entered until O is entered. Then the student's name and total are displayed. start Declarations string name num score string QUIT = - "XXX" num OUIT SCORE = 0 num total (housekeeping () output "Please enter name or XXX to quit" input name housekeeping O return name <> QUIT? No Yes detailLoop( (endofjob () endofJob ( stop output "Job complete" (return what needs to be added and fixed? Debugging 5-04The 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).• Task 1: Find the even multiples of any number chosen by the user in a given range - the user should specify the multiples of which number they want to print and a minimum and maximum value. The multiples printed should be within the [minimum, maximum] range. For example, if the user choses the number 7 and would like to print all even multiples in the [15, 60] range, the program should print all the even multiples that are bigger than or equal to 15 (minimum), but smaller than or equal to 60 (maximum). The program should keep a count of how many numbers were printed and should output that count, as well as the numbers. The output then, for the example given, should be 28, 42, 56, and the count should be 3.
- A contractor orders, say, 30 cubic yards of premixed concrete to construct a patio that is to be, say, four inches thick. The length of the patio is to be, say, twice the width. Write a program that prompts the user to specify: The amount of premixed concrete (in cubic yards) ordered The thickness of the patio (in inches) The ratio of length and width Ex. If the ratio is 3 to 2, have the program accept a 3 then a 2. Then compute the ratio using these numbers The program then outputs: The length and width of the patio (in feet). (1 cubic yard = 27 cubic feet.) To calculate the width, you will need to: Find the total cubic feet of the concrete Divide the total cubic feet of concrete by the result of the length to width ratio multiplied by the thickness of the patio, over 12 (inches in a foot) Square root the answer To find the square root of a decimal number, include the header file cmath using the statement #include <cmath>, in your program. The function sqrt, included in…The ideal gas law allows the calculation of volume of a gas given the pressure(P), amount of the gas (n), and the temperature (T). The equation is:V = nRT / PSince we only have used integer arithmetic, all numbers will be integer values with no decimal points. The constant R is 8.314 and will be specified as (8314/1000). This gives the same result. Implement the idea gas law program where the user is prompted for and enters values for n, T, and P, and V is calculated and printed out. Be careful to implement an accurate version of this program. Your program should include a proper and useful prompt for input, and print the results in a meaningful manner.For this assignment, write a program named PizzaPrices that prompts the user to make a choice for a pizza size - S,M, L, or X - and the number of pizza the user wants to order. The price for different size pizzas are $6.99, $8.99, $12.5, and $15.0 respectively. There is also a discount based on the number of pizza ordered: no discount for one pizza, 10% discount for 2 pizzas, 15% discount for 3-5 pizzas, and 20% for more than 5 pizzas. Display a full accounting of the transaction, similar to the sample screenshot. Please make sure you use parallel arrays and range match in your solution.
- Exercise 3.9Modify program P34_1.cpp to compute the side area, total area, and volume of a cylinder and thearea and volume of a sphere, depending on the choice that the user makes. Your program shouldask users to enter 1 to choose cylinder or 2 for sphere, and display an "invalid choice error" forother values.For a cylinder, we want to compute:Side area: (2*PI*r) * hTotal Area: 2*(PI*r2) + Side areaVolume: (PI*r2)*hFor a sphere, we want to compute:Surface area: 4*PI*r2Volume: (4.0/3.0)*PI*r3.Use overloading whenever possible.Call your new program Ex39.cpp.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 semesterstoppingDistance = speed * (2.25 + speed / 21)Write a program which determines whether a vehicle’s tailgating distance is safe.The program should read in the speed of the vehicle and the vehicle’s tailgatingdistance. The program should then calculate the distance that would be required tostop the vehicle.If the stopping distance is less than the tailgating distance, your programshould print “No problem.” If the stopping distance equals the tailgatingdistance, your program should print “Minor wreck.” If the stopping distanceis greater than the tailgating distance, your program should print “Majorwreck!”Notice that the expression on the right side of the formula above will force thecompiler to convert everything to type double. Use type double for your workingvariables. Write your program so that it is able to produce the following screendisplay:Sample session:Enter your speed (in mph): 60.0Enter your tailgate distance (in feet): 240.0Major wreck!