Write a single statement that assigns avg_sales with the average of num_sales1, num_sales2, and num_sales3. Sample output with inputs: 3 4 8Average sales: 5.00 Coding avg_sales = 0 num_sales1 = int(input()) num_sales2 = int(input()) num_sales3 = int(input()) ''' Your solution goes here ''' print('Average sales: {:.2f}'.format(avg_sales))
Q: The resultant of A OR B Select one: a. Is always true except when A and B are both false. b. Is…
A: PLEASE DO SUPPORT FOR MY EFFORTS THANKS! ANSWER: a) is always true except both A and B are false…
Q: (Reading an Integer with Each scanf Conversion Specifier) Write a program that inputs thevalue 437…
A:
Q: Write an expression using Boolean operators that prints "Special number" if special_num is -99, 0,…
A: Input : Input number from user Output : Check if the number is special or not.
Q: Write a program to read integer and display one as a percentage of it. You need to identify the…
A: import java.util.*;public class Main{ public static void main(String[] args) { Scanner scan =…
Q: a simple code to evaluate or find the final time of a given period of time, expressing it in hours…
A: Task : Given the time , min and lasts. The task is to find the new time.
Q: The number of min term after minimizing the following Boolean expression ts IDAB AC AC D ACD
A: The answer for number of min-term after minimizing the following boolean expression is
Q: e date June 10, 1960, is special because when it is written numerically, the month time the day…
A: Here no language is mentioned so I have given python code to implement the given question.
Q: Write a statement that assigns total_coins with the sum of nickel_count and dime_count. Sample…
A: First, we will input the nickel count and then dime_count. We will find the sum of nickel count and…
Q: Frosh commencing their studies at Waterloo have diverse interests, as evidenced by their desire to…
A: * This question is solved in C++ programming language * #include <vector> #include…
Q: Write a complete program using console input and output. 1. Use iomanip library functions to…
A: setw(size) function in iomanip library is used to display the output with defined 'size'. use…
Q: Take an hour from the user as input and tell it is time for which meal. • The user will input the…
A: As no programming language is mentioned. So I am using Python.
Q: A cashier distributes change using the maximum number of five-dollar bills, followed by one-dollar…
A: Start input dollar calculate five dollar bill by dollar /5 then calculate one dollar bill by…
Q: blai 5 Q2: Give the output of the following program 1. S-input('Enter the subject:','s'); 2.…
A: Ans: Code S= input('Enter the subject:','s'); fprintf('subject is %s\n', S) M1 = input('Enter the…
Q: If you run Listing 4.4 GuessBirthday.cpp with input Y for Set1, Set3, and Set4 and N for Set2 and…
A: Listing 4.4 GuessBirthday.cpp is a program which checks the birthday in different sets and then…
Q: Write a complete program using console input and output. 1. Use iomanip library functions to…
A: (1)First determine the number of Items (2)Read the information from the console (3)Display the data…
Q: Using nested loops, print the money from 1 dollar and 0 cents to 10 dollars and 0 cents, going up by…
A: #include <stdio.h> int main(){ int d,c; for(d=1;d<10;d++){ //d…
Q: Input Input Input Cashier name Item name Item price ? AndrewKing Milk 2.99 OK Cancel OK Cancel OK…
A: Program: import java.util.Scanner; public class StoreReceipt { static final double TSHIRT_PRICE =…
Q: Q3 // What is the output of the following A= ((3 = = 3) && (9>5));[ B= !(6 > 6); C= ((4 > - 4) ||…
A: A = ((3 == 3) && (9>5)); // True && True => True B = !(6>6);…
Q: Write an if-else statement for the following: If user_tickets is less than 5, assign 1 to…
A: Required:
Q: 1. Write a program to find the square of two numbers 10, -4. 2. Write a program to find the square…
A: To Write Program for Find the square of two numbers 10, -4 Find the square of any two numbers To…
Q: Create a program that gives the user to display the sum of the first and second numbers, difference…
A: 1) Since you have not specified programming language, I have written program in python 2) Below is…
Q: The average cost of a college textbook is $125. There is a premium of 20% on hardcover text and a…
A: conditions :- In case of hardcover text if n>4 total=n*avg_cost+ (premium*(n*avg_cost)/100)…
Q: utput with input: 10
A: Code: userinput = int(input())if(userinput>=9 and userinput<=12): print("in high…
Q: tters is more than lowercase letters. Otherwise, if lowercase is greate - uppercase letters, print…
A: GIVEN: For a given string, If the uppercase letters are greater than lowercase letters, convert the…
Q: Write an expression that will print "in high school" if the value of user_grade is between 9 and 12…
A: Required:
Q: Write a program which takes year as an input through the keyboard then it determines whether the…
A: CODE : #include <bits/stdc++.h>using namespace std; bool checkYear(int year){ return (((year %…
Q: Using nested loops, print the money from 1 dollar and 0 cents to 10 dollars and 0 cents, going up by…
A: - Solving both the java problems.
Q: Problem: Read your name and one numeric value [Omani Rial], print the following in below output,…
A: PROGRAM CODE: #include <stdio.h> // include header file for standard input output…
Q: Write a program to determine the cost of an automobile insurance premium, based on driver's age. and…
A: Code: import java.io.IOException;import java.util.Scanner;class Main { public static void…
Q: Write a program that asks the user to input the Employee rank and salary. Possible ranks are…
A: Required: Write a program that asks the user to input the Employee rank and salary. Possible ranks…
Q: stop = int(input()) result = 0 for n in range(10): result += n + 2 if result > stop: break print(n)…
A: Given: stop = int(input()) result = 0 for n in range(10): result += n + 2 if result >…
Q: Using the C++ Continuous Inputs by CodeChum Admin Write a program that will keep asking the user…
A: Algorithm: Start Initialize sum to 0 Read a number n If n==-1 or sum>=2000, print sum and goto…
Q: c++ Use input validation to read two whole whole numbers, A and B, // which must satisfy the rule…
A: Check the answer below.
Q: What is the output of this code segment when the input value of x equal 9, input value of y equal 2…
A: Given data: x = 9 y = 2 symbol = "/".
Q: Write 2 different programs using if statement and switch statement that will ask the user which…
A: #include<stdio.h>int main(){ double firstN, secondN; char ch; printf("Enter the…
Q: %% [0-9] printf("number"); [a-zA-Z] printf("letter"); T+EN+ printf("10"); According to…
A: In lex rules, for some input string output is given according to the first matched rules. And…
Q: Give the output for the following The input is 3 57-6 10 int temp = 0; int num; int count; cin >>…
A: 3, -2, -2 and -8
Q: Write a program that prompts the user to input a positive odd integer and a character. The program…
A: The C++ code along with the snapshot of code and output is given below.
Q: Write a program that computes factorial for a desired number repeatedly until -1 is entered.Expected…
A: 1- Since you have not provided the language to write the code so I am using java language. 2- In…
Q: Write a single statement that prints outsideTemperature with 4 digits. End with newline. Sample…
A: Convert given temperature into 4 digits:- For example:- 103.45632 Output:- 103.5
Q: Write code to complete DoublePennies()'s base case. Sample output for below program with inputs 1…
A: Please find the answer below :
Q: A variable like userNum can store a value like an integer. Extend the given program to print userNum…
A: The required code is as follows:-
Q: stop = int(input()) result = 0 for n in range(10): result += n + 4 if result > stop: break print(n)…
A: Here we are taking input from the user and then storing the input to a variable named stop. Next, we…
Q: Write a program that, depending on the user's choice inputs int, double or string variable. If the…
A: Take the user input put them in switch case and print the output.
Q: Frosh commencing their studies at Waterloo have diverse interests, as evidenced by their desire to…
A: Program: #include <bits/stdc++.h>using namespace std; int main(){ int N; cin >>…
Q: Write a JAVÀ program that determines the alert level for the COVID-19 based on the percentage of new…
A: public class IfExample { public static void main(String[] args) { int new_cases,no_PCR_test;…
Q: Write a program that computers and assess the tuition fee of the students in one trimester, based on…
A: Program Explanation- Enter the tuition fee. Print choice menu. Switch between the choices. Fee…
Q: Write C++ program that asks the user for 10 numbers. Calculate how many inputs were less than or…
A: The problem is based on the basics of loops in C++ programming language.
Q: A factory manufactures electricity lamps, all of which are tested to find their lamp Lighting Level.…
A: Below is the required Java program: - Approach: - Import the package. Define the main class. Define…
Write a single statement that assigns avg_sales with the average of num_sales1, num_sales2, and num_sales3.
Sample output with inputs: 3 4 8Average sales: 5.00
Coding
avg_sales = 0
num_sales1 = int(input())
num_sales2 = int(input())
num_sales3 = int(input())
''' Your solution goes here '''
print('Average sales: {:.2f}'.format(avg_sales))
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images
- Using a conditional expression, write a statement that increments num_users if update_direction is 3, otherwise decrements num_users.Sample output with inputs: 8 3New value is: 9 num_users = int(input())update_direction = int(input()) num_users = your solution goes here print('New value is:', num_users)Using a conditional expression, write a statement that increments num_users if update_direction is 3, otherwise decrements num_users.Sample output with inputs: 8 3 New value is: 9 num_users = int(input())update_direction = int(input()) num_users = ''' Your solution goes here ''' print('New value is:', num_users)Write a statement that assigns total_coins with the sum of nickel_count and dime_count. Sample output for 100 nickels and 200 dimes is: 300 total_coins = 0 nickel_count = int(input())dime_count = int(input()) ''' Your solution goes here ''' print(total_coins)
- Here_______Continuous Inputs___. by CodeChum Admin Write a program that will keep asking the user to input integers until he inputs -1, or the sum of all inputs have reached or exceeded 2000. When the sum has exceeded 499, print "You're off to a good start!". When the sum exceeds 999, print "You're halfway through!". Finally, when the sum exceeds 1499, print "You're almost there!". If the program ended because of an input of -1, print "Program was terminated. Your total sales are: " and then the actual value of the total sales. Otherwise, print "Congratulations! Your total sales are: " Input 1. Series of integer inputs Description Several integer inputs that will either reach a sum of 2000, or ends with a -1. Sample 500 200 100 -1 Output The output depends on the inputs. Refer to the Problem Description for the messages to be printed. Enter·value:·500 You're·off·to·a·good·start! Enter·value:·200 You're·off·to·a·good·start! Enter·value:·100…Input a grade level (Freshman, (Sophomore, (Junior, or Senior ) and print the corresponding grade number [9-12]. If it is not one of those grade levels, print Not in High School Hint: Since this lesson uses else-if statements, remember to use at least one else-if statement in your answer to receive full credit Sample Run 1 What year of high school are you in? Freshman Sample Output 1 You are in grade: 9 Sample Run 2 What year of high school are you in? Kindergarten Sample Output 2 Not in High SchoolEvaluate the following Postfix Expression 6 2 3 + - 3 8 2 / + * 2 & 3 + Hint: the output should be 52 like the picture.
- Write an expression that continues to bid until the user enters 'n'.Sample output with inputs: 'y' 'y' 'n'I'll bid $7! Continue bidding? I'll bid $15! Continue bidding? I'll bid $23! Continue bidding?The date June 10, 1960, is special because when it is written numerically, the month time the day equals the year:6/10/60 --> 6*10 = 60Design a program that asks the user to enter a month (in numeric form), a day, and a two-digit year in three separate inputs. The program should determine whether the month times the day equals the year. If so, it should print, "This date is magic!" Otherwise, it should print, "This date is not magic." Sample RunEnter month (numeric):12↵Enter day:8↵Enter two digit year:96↵This date is magic!↵Write a Tip program that asks the user for the price (before tip) and outputs the final price (including tip). If price is less than 50 then tip is 15%, else tip is 18%. Calculate the total price including the tip. Then, practice by handwriting the code. Sample Run: Enter the price 45 The total price is 51.75 Enter the price 55 The total price is 64.9
- C++ Question Write a program that reads any 5 numbers as in the given sample of output below: Sample of output: Enter any 5 integer value. 1 2 -1 3 0 The number of positive value is 3 The numbers are: 1 2 3 The number of negative value is 1 The numbers are: -1 The 0 number is 1 The total is 5.0 The average is 1.25Write 2 different programs using if statement and switch statement that will ask the user which mathematical operation they like. Prompt the user to enter two integer numbers. Based from the mathematical operation selected, display the answer. Consider the following sample output: A- Addition B- Subtraction C- Multiplication D- Division Choose operation [A/B/C/D]: A Math Operation: Addition Enter 1st number: 1 Enter 2nd number: 2 The sum is: 3Write a program that accepts an input grade in percentile form and output itsgrade equivalent; based on the given range of percentile and grade equivalent table below:RangeGrade98-‐1001.0095-‐971.2592-‐941.5089-‐911.7585-‐882.0082-‐842.2580-‐812.5077-‐792.7575-‐763.0OtherGradesOutofRange