1) to stop entering new values. The while entered by the user is not -1. Example output: Enter miles driven(-1 to quit): 287 Enter gallons used: 13 Miles per gallon is 22.07 Enter miles driven(-1) to quit: -1|
Q: Write a program that prints the first few verses of the traveling song "One Hundred Bottles of…
A: Here, I have to write a java solution to the above question.
Q: With the statement, With the statement, int grade=198; int grade=100;…
A: The output of the first question is an Invalid grade. The output of the second question is an…
Q: The boy scouts' popcorn supplies are all over the place and troops are only receiving certain…
A: Python used to answer this question
Q: Write a program that calculates the occupancy rate for a hotel. The program should start by asking…
A: Answer: Executable Code: n = int(input("Floors on the hotel: "))occupied = 0unoccupied = 0totalRooms…
Q: Write a program that asks the user to enter today’s sales for five stores. The program should then…
A: Following is the c++ program that takes as input from user sales of five stores and display the…
Q: Write a program that prints the numbers from 1 to 100, except if the number is divisible by 3 print…
A:
Q: Answer the ff looping problems- WHILE LOOP 1. Allow the user to input integer values and sum up…
A: The Jаvа while lоор is used tо iterаte а раrt оf the рrоgrаm reрeаtedly until the…
Q: Write a program that asks the user to enter the amount that he or she has budgeted for a month. A…
A: As there is no programming language mentioned so question is attempted in python language. enter…
Q: Write a program that uses for loops to perform the following steps: Prompt the user to input two…
A: THe answer is..
Q: Write pseudocode that prints out 3 offices, with 5 employees each. You must use a nested loop. Your…
A: Note :- You have not mention the language of the program for output , so i'm answering your question…
Q: Using Python to write a program with a loop that asks the user to enter a series of positive…
A: Algorithm: Start Initialize total to 0 Iterate through the loop Ask user to enter a number If…
Q: There are 6 employees. Write a program with nested loops, to ask the yearly salary of each employee…
A: In this program, you need to take user input for salary of 6 employees for 5 years. After taking…
Q: Use C language in this program
A: Here I have created a function named gcd(). Inside the function, I have created the condition to…
Q: A mail order house sells five different products whose retail prices are: product 1: $2.98 product…
A: C++ used to answer this question
Q: Write a program that prompts the user to enter an integer number n, and outputs the terms of a…
A: The problem is about use of loops to print the sequence genrated by dividing the firtsly number and…
Q: Write a program that generates a random number between 1 and 100 and asks the user to guess what the…
A: Lets see the solution.
Q: Write a program that calculates the balance of a savings account at the end of a three- month…
A: Program code: #include <iostream> using namespace std; //…
Q: Write a program that uses nested loops to collect data and calculate the average rainfall over a…
A: The C++ program is written for rainfall calculation using the nested loop where it takes the input…
Q: Write a program that uses nested loops to collect data and calculate the average rainfall over a…
A: #include<iostream> using namespace std; int main(){ int numberOfYears=0, totalRainfall=0;…
Q: In this program you will use a nested loop to generate the following outputs: $ ./a.out 1 22 333…
A: Hello student Greetings Hope you are doing great. Thank You!!!
Q: Write a program that will print the message “Computer Science is cool!!” 10 times. Use a while loop.…
A: As there is no programming language mentioned so program is attempted in c++ language 1. Write a…
Q: Write a software called Digits that asks the user for a positive integer, then reverses the number…
A: PROGRAM INTRODUCTION: Include the required header files. Declare and initialize the required global…
Q: Design a VI in LabVIEW to display the sum of first 'n' numbers using for loop, e.g., if user enters…
A: here in this question we will develop program which will accept number from user and then it will…
Q: Task 2: Multiples Write a program that asks the user for an integer n, and then prints fırst 10…
A: The problem is based on the basics of while loop in programming languages. NOTE: The solution is in…
Q: Write some code that uses a while loop to get 10 integers from the user, one at a time. When all…
A: Given: Write some code that uses a while loop to get 10 integers from the user, one at a time. When…
Q: Write a program that uses a while loop to enter any number of positive integers. When the loop ends,…
A: Given: Write a program that uses a while loop to enter any number of positive integers. When the…
Q: Write a program that calculates a student's GPA. Ask the user to enter grade and also the credit…
A: Sample Response: //C++ program to calculate and print the GPA#include <iostream>using…
Q: For example, if a vehicle travels 40 miles per hour for 3 hours, the distance traveled is 120 miles.…
A: Algorithm 1. Start 2. Var hour, speed, distance=0 3. Accept a non zero positive input as hours from…
Q: Write a program that asks the user to enter the amount that he or she has budgeted for a month. A…
A: The javascript code is embedded in the HTML page using the script tag. Take monthly budget as input…
Q: This program will resemble a comp appl that is used to show the largest value in a series well for…
A: The program is solved in c++ as the programing language in the question is not provided. Below is…
Q: Write a program that calculates the occupancy rate of the 120 suites (20 per floor) located on the…
A: Program code: #include <iostream> using namespace std; int main() { const int OCC = 120;…
Q: Write a program that displays a weekly payroll report. A loop in the program should ask the user for…
A: Answer: The program has shown below- #include<iostream> #include<stdlib.h> using…
Q: Write a Basic program to calculate Y value if the condition (Y <0) break the loop and Y equation as…
A: Algorithm: Start Read n value Initialize x and d to 1 Initialize y to 0 Calculate…
Q: Write a program that allows the user to enter a series of exam scores. The number of scores the user…
A:
Q: Given the code: int x; cout > x; Write a loop to print all numbers from 1 to x inclusive that are…
A: We have to find the numbers who are not the factors of X. Read x. for i = 1 check if n%i is not…
Q: Write a software called Digits that asks the user for a positive integer, then reverses the number…
A: Because no programming language is mentioned here. As a result, we're offering a Java-based…
Q: Write a program that allows the user to enter a series of exam scores. The number of scores the user…
A: Following is the python program to calculate the average of a series of exam scores: Approach:…
Q: Write a program that generates a random number and asks the user to guess what the num- ber is. If…
A: C++ Code: #include <iostream> using namespace std; int main(){ int num, guess, tries = 0;…
Q: Write a program that uses a for loop to display a table that lists in one column values for ounces,…
A: - We have to code for printing the table for ounces, pints, quartz and litres.
Q: Write a program in Python that sums a series of (positive) integers entered by the user, excluding…
A: Use a while loop to iterate and here we check whether to enter loop or not based on the input value…
Q: Write a program that requests the current time and a waiting time as two integers for the number of…
A: Given that, Write a program that requests the current time and a waiting time as two integers for…
Q: Write a program that will predict the size of a population of organisms. The program should ask the…
A: PROGRAMING CODE: #include <iostream>#include <iomanip>using namespace std; int main(){…
Q: Write a program that asks the user to enter today’s sales for five stores. The program should then…
A: To solve this program following variables, data types and methods are used to calculate the sell…
Q: A tennis club , which currently charges $150 per month for membership, has told the members that…
A: #note no programming language is mentioned so i was used c++ programming language…
Q: Write a program that calculates the balance of a savings account at the end of a three- month…
A: Actually, program is an executable software that runs on a computer.
Q: Modify the given program to only accept an arrow head width that is larger than the arrow base…
A: /* Program after modification */ import java.util.*; //Main function public class Main{ public…
Q: Write a program Digits that prompts the user to input a positive integer and then outputs the number…
A: Since, here no programming language is specified. So, we are providing the solution in Java. The…
Q: each of the expenses (zero indicates the user is done with entering an expense) for the month and…
A: CODE:- import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: Write a complete program that: 1. Uses a do...while loop to prompt the user to enter a count that is…
A: Answer :
Write a
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Assignment Write a program that tracks how much steps the user walks in total in a day and reports if the daily target is reached or not. The program will keep reading double values, each representing steps walked during an individual activity within a day (stepsWalked) until either the user enters a negative value or the daily target of 5000 steps is met. If the user enters a negative number, the program should print total steps walked as a double. Otherwise, if the target is exactly reached, the program should simply print "Target is reached", finally if the target is surpassed the program should print the text "Target is surpassed by", followed by the excess amount above the target as a double, and finally printing the text "steps". NOTE: You MUST use a repetitive statement in this question. NOTE: Each stepsWalked value will be given as a non-negative value. You do NOT need to check this. Input Output Answer assignment 3000 1300 500 2305.2 Target is surpassed by 2105.2 steps 450…PROBLEM: Write a program that prompts the user to input first name, middle initial, and last name (in upper case) for an ID card. There is a 22-character limit that also includes spaces in between the names on the ID card. The following conditions/limitations are observed: A. If the first name, second name, middle initial, and last name exceed the character limit, use the first name initial and last name. B. If the last name's character count is greater than or equal to the character limit, omit the second name and middle initial. Use the first name initial and truncate the last name to fit the character limit. C. The spaces in between the first name, second name, middle initial, and last name should not be included in the input. D. If there is no second name or middle initial, input 0. E. Omit any space in the last name, e.g., DE GUZMAN will be DEGUZMAN. SPECIFICATIONS: - You may only use the codes that we studied under our lectures - All lines of codes should have a comment. - Save…The company discounted used cars pays their employees according to this chart: 250$ per months plus 50$ per car sold. If the salesman sells more than 10 cars, the employee receives a bonus of 5% of the total of his sales, in addition to his regular salary.Each month, the owner sits in front of the computer, and enters the following information: The name of the employee, the number of cars sold, as well as the total of all the sales for the month. algorithm that will calculate the salary of an employee for the month, and then display on the screen, his name, total cars sold, base salary, bonus if applicable and entire salary
- Question: Party budget planning - complex Prompt the user to enter their current budget and the number of people who need to share a meal. You are ordering food from a restaurant that has two menu items: Tacos $4 Empanadas $3 Calculate and print out all the options of meals where the budget is used entirely(where possible) and each person has an equal number of items to eat. They may eat different things, but everyone gets the same number of food items, e.g. 2 tacos or 1 empanada and 1 taco or 2 empanadas. Hints: Here are some things that might help you in your solution. If total items purchased does not equally divide by the number of diners, then abandon that combination. It may help to calculate the max number of empanadas that the budget can buy and also the max number of tacos that the budget could buy. These can be thought of as upper bounds in your loops. In your solution, keep track of items per person Also, keep track of total number of viable solutions, as that might…Question: Party budget planning - complex Prompt the user to enter their current budget and the number of people who need to share a meal. You are ordering food from a restaurant that has two menu items: Tacos $4 Empanadas $3 Calculate and print out all the options of meals where the budget is used entirely(where possible) and each person has an equal number of items to eat. They may eat different things, but everyone gets the same number of food items, e.g. 2 tacos or 1 empanada and 1 taco or 2 empanadas. Hints: Here are some things that might help you in your solution. If total items purchased does not equally divide by the number of diners, then abandon that combination. It may help to calculate the max number of empanadas that the budget can buy and also the max number of tacos that the budget could buy. These can be thought of as upper bounds in your loops. In your solution, keep track of items per person Also, keep track of total number of viable solutions, as that might…(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.
- When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making periodic payments over a certain period of time. Of course, the lending company will charge interest on the loan. Every periodic payment consists of the interest on the loan and the payment toward the principal amount. To be specific, suppose that you borrow $1,000 at an interest rate of 7.2% per year and the payments are monthly. Suppose that your monthly payment is $25. Now, the interest is 7.2% per year and the payments are monthly, so the interest rate per month is 7.2/12 = 0.6%. The first months interest on $1,000 is 1000 0.006 = 6. Because the payment is $25 and the interest for the first month is $6, the payment toward the principal amount is 25 6 = 19. This means after making the first payment, the loan amount is 1,000 19 = 981. For the second payment, the interest is calculated on $981. So the interest for the second month is 981 0.006 = 5.886, that is, approximately $5.89. This implies that the payment toward the principal is 25 5.89 = 19.11 and the remaining balance after the second payment is 981 19.11 = 961.89. This process is repeated until the loan is paid. Write a program that accepts as input the loan amount, the interest rate per year, and the monthly payment. (Enter the interest rate as a percentage. For example, if the interest rate is 7.2% per year, then enter 7.2.) The program then outputs the number of months it would take to repay the loan. (Note that if the monthly payment is less than the first months interest, then after each payment, the loan amount will increase. In this case, the program must warn the borrower that the monthly payment is too low, and with this monthly payment, the loan amount could not be repaid.)Compute the income tax due on taxable income entered by the user, given the data as shown in the following table. Be sure to include error checking to make sure the user does not enter a negative number. Assume all entries are integer values. Taxable Income Tax Due From To $0 $49,999 $0 + 5% of amount over $0 $50,000 $99,999 $2,500 +7% of amount over $50,000 $100,000 $6,000 + 9% of amount over $100,000 (Provide the following: Pseudocode; Flowchart) Dago 2 of 5Hi! I am having trouble with this problem: Each week, the Pickering Trucking Company randomly selects one of its 30 employees to take a drug test. Write an application that determines which employee will be selected each week for the next 52 weeks. Use the Math.random() function to generate an employee number between 1 and 30. After each selection, display the number of the employee to test. Display four employee numbers on each line. It is important to note that if testing is random, some employees will be tested multiple times, and others might never be tested. Run the application several times until you are confident that the selection is random. Save the file as DrugTests.java. My code is on the photo. I want to add the text "Week # (insert week number here). Employee # (insert employee number here)" but I have been unsuccessful in my attempts. Any help would be great!
- use visual basic Depreciation to a Salvage Value of 0 . For tax purposes an item may be depreciated over a period of several years, n . With the straight-line method of depreciation , each year the item dpreciates by 1/nth of it original value. with the double-declining-balance method of depreciation, each year the item depreciate by 2/nths of its value at the beginning of that year.(In the final year it is depreciated by its value at the beginning of the year. ) Write a program that performs the following tasks:(a) Request a description of the item, the year of purchase, the cost of the item, the number of years to be depreciated (estimated life), and the method of depreciation. The method of depreciation should be chosen by clicking on one of two buttons.(b) Display a year- by-year description of the depreciation. See Fig. 6.15 .The company « Super discounted used cars inc.» pays their employees according to this chart: 250$ per months plus 50$ per car sold. If the salesman sells more than 10 cars, the employee receives a bonus of 5% of the total of his sales, in addition to his regular salary. Each month, the owner sits in front of the computer, and enters the following information: The name of the employee, the number of cars sold, as well as the total of all the sales for the month. Write an algorithm that will calculate the salary of an employee for the month, and then display on the screen, his name, total cars sold, base salary, bonus if applicable and entire salary.The company « Super discounted used cars inc.» pays their employees according to this chart: 250$ per months plus 50$ per car sold. If the salesman sells more than 10 cars, the employee receives a bonus of 5% of the total of his sales, in addition to his regular salary. Each month, the owner sits in front of the computer, and enters the following information: The name of the employee, the number of cars sold, as well as the total of all the sales for the month. algorithm that will calculate the salary of an employee for the month, and then display on the screen, his name, total cars sold, base salary, bonus if applicable and entire salary. Each input must be validated.and make trace memory screen