6) Write a program that prompts the user to input a number. The program should then output the number and a message saying whether the number is positive, negative, or zero. 7) Write a program that asks the user the number of hours an employee worked and his hourly wage, computes his weekly pay. Count any hours over 40 as overtime at time-and-a-half.
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: 20. or the following code if x = 2: print ('Two or more) else : print (Something else) What value of…
A: We are given a code snippet and we will compare values of x, and statements will be printed…
Q: TASK 3: Write a program that accepts the input code from the user and print according to the input…
A: in c: #include <stdio.h>int main(){ int n1; printf("enter the number: ");…
Q: Write a program that takes a range from the user and display all the even numbers between the range…
A: Note - Since there is nothing mentioned about the programming language to be used, so this program…
Q: 8) Write a program that asks for the user’s name and then the program will output the last 4…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: write a program c++ If the temperature is above 100 degrees, display the message “above the boiling…
A: #include<bits/stdc++.h>using namespace std;int main(){ int temp; cout<<"Please…
Q: - If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of…
A: Actually, program is an executable software that runs on a computer.
Q: money is left in a particular bank for more than 5 years, the bank pays interest at a rate of 4.5%…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED C++ FOR THE SOLUTION Define…
Q: Java
A: Program: //Import necessary packages import java.util.Scanner; //Define a class named Months public…
Q: 3. Output greatest value. Given three numbers, write a program that outputs the number with the…
A: import java.util.*; //Main classpublic class Main{ //Main class method public static void…
Q: 6. (Display the first days of each month) Write a program that prompts the user to enter the year…
A: Hey, since there are multiple questions posted, we will answer first question. If you want any…
Q: Write a program that prompts the user to input a positive integer, and then calculates and displays…
A: Positive numbers are those numbers that are greater than 0.
Q: 3. Output greatest value. Given three numbers, write a program that outputs the number with the…
A: As per our guidelines, we are supposed to answer only one question. Kindly repost the remaining…
Q: 1. Write a program that prompts the user to enter an integer between 0 and 6 and prints thie day…
A: I give both codes in C along with output and code screenshots.
Q: program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output the gas…
A: Introduction of Program: In this C++ program, the User enters the car consume how many miles in 1…
Q: 14. Write a program that will accept two integer values in an input dialog 10 box. Get the higher…
A: import javax.swing.JOptionPane; public class Main { public static void main(String[] args) {…
Q: 1. Write a program that does the following: Ask the user to enter the price of their items. The user…
A: Actually, program is a executable software that runs on a computer.
Q: 1. Write a program that prints "You have passed" if a student gets a score of 50 and above, and…
A: QUESTION 1 PART 1 import java.util.*;public class HelloWorld{public static void main(String…
Q: Q3.Write a program that input the month and the day. If the month entered isn't between I and 12,…
A: Note: Since programming language is not mentioned. Therefore answering the question in python…
Q: Q2: Write a program to compute and display a person's weekly salary as determined by the following…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Read no.of hours n…
Q: Write a Program to enter the numbers till the user wants and at the end it should display the count…
A: Code :
Q: Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output…
A: import java.util.*;class Test89 { public static void main(String args[]) { Scanner sc = new…
Q: //////////// //////////// //////////// how do i solve this problem in java. please do not use…
A: Program Instructions:Use scanner class object to get the user input.Use if-else statements to print…
Q: program so that the user enters the rate of tuition increase for the first year. the rate then…
A: C++ used to answer this question
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: Q3: Write a VB program to enter a mark of a student and then find his grade as If mark >=75 print…
A: Algorithm 1.create one module name is marks 2.enter student name marks 3.calculate total marks…
Q: Q1) Write a program that takes as input any change expressed in Saudi Riyals. It should then compute…
A: //Note: Always the language of code in which you want the result. //For Now I am doing this in java…
Q: Q2a) A milk carton can hold 3.78 liters of milk. Each morning, a dairy farm ships cartons of milk…
A: 2a) The code is given below: #include <iostream>#include <iomanip> using namespace…
Q: A customer in a store is purchasing five items. Write a program that asks for the price of each…
A:
Q: 2) Write a programC++ that asks the user to enter two integers, and then prints the larger number…
A:
Q: 3. Output greatest value. Given three numbers, write a program that outputs the number with the…
A: Write a C program to return the greatest number among three using the ternary operator.
Q: Write a program that asks for the number of calories and fat grams in a food. The program should…
A: Hello Student. Warm welcome from my side. Hope you are doing great. Here's your answer. Since you…
Q: (Find the two lowest scores) Write a program of C++ that prompts the user to enter the number of…
A: Actually, c++ is a powerful general purpose language.
Q: Write a program that repeatedly prompts a student to enter grade points (on a scale of 0-4) and…
A: Please find the answer below :
Q: Write a program that allows the user to input their weight in, height in feet, age in years, and…
A: Body mass index is a person's weight in kilograms divided by the square of height in meters.
Q: 6. (Display the first days of each month) Write a program that prompts the user to enter the year…
A: Program: import java.util.Scanner; public class Main { // months name[] // 0 index is empty so…
Q: Write program to print all the numbers divisible by 4 and 5 up to a number of
A: Approach For instance, if N = 20 is set as either a restriction, the program must report any values…
Q: (b) A triangle can be classified based on the lengths of its sides as equilateral. isosceles or…
A: Algorithm for the code: Step 1: Declare three sides of the triangle. Step 2: Enter three sides at…
Q: Write a program that prompts the user to enter an integer and determines whether it is divisible by…
A: Since there is no programming language, below is the program in python.
Q: The date June 10, 1960, is special because when we write it in the following format, the month times…
A: since you have not mentioned the programming language, I will attempt in python. please repost again…
Q: 1. Federal law requires that hourly employees be paid "time-and-a-half" for work in excess of 40…
A: #ask user for hourly wage hourly_wage = float(input('\nEnter hourly wage: ')) #ask user for Number…
Q: Write a program that prompts the user to enter the month and year and displays the number of days in…
A: February has 28 days in non-leap years and has 29 days in leap years
Q: 3. The program that asks a number and test the number whether it is multiple of 5 or not, divisible…
A: #3. number = int(input("Enter a number: ")) # taking the number from user if…
Q: Write a program to give the example for ‘this’ operator. And also use the ‘this’ keyword as return…
A: #include <iostream> using namespace std; class Demo { private: int num; char ch; public:…
Q: Write a program that asks for the number of calories and fat grams in a food. The program should…
A: Write a program that asks for the number of calories and fat grams in a food. The program should…
Q: (a) If the number is positive, add the number to the variable positiveSum; (a) else, add the number…
A: A) The equivalent c++ code is if(number>0) { positiveSum+=number; } else if(number<0) {…
Q: 1- Write a program in which the user is asked to enter his age based on the year (assuming the…
A: Take input from user. check if the number is positive integer or no. and if the number is positive…
Q: The date June 10, 1960, is special because when we write it in the following format, the month times…
A: Java : Java is a class-based, object-situated programming language that is intended to have as…
Q: 3)Write a program which prompts the user for their age. If they are 19 or younger inform them that…
A: Note- As per our guidelines we are supposed to answer only one question(first) if there are multiple…
in c++
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images
- C++ Write a program that prompts the user to enter the number of students and each student's name and score. and finally displays the name and score of the student with the highest score and the average score.1. Federal law requires that hourly employees be paid “time-and-a-half” for work in excess of 40 hours in a week.For example, if a person’s hourly wage is $12 and he or she works 60 hours in a week, the person’s gross pay shouldbe (40 *12) + (1.5 *12 * (60-40)) = $840.Write a program that requests the floating number of hours a person works in a given week and the person’s hourlywage as input, and then displays the person’s gross pay. Save it as overtimePay.pywrite a program that prompts the user to enter the number of students and each student name and score and finally display the name of student with highest score and the student with second highest score.
- a. Write a program named CheckMonth that prompts a user to enter a birth month. If the value entered is greater than 12 or less than 1, display an error message; otherwise, display the valid month with a message such as 3 is a valid month. b. Write a program named CheckM0nth2 that prompts a user to enter a birth month and day. Display an error message if the month is invalid (not I through 12) or the day is invalid for the month (for example, not between 1 and 31 for January or between I and 29 for February). If the month and day are valid, display them with a message.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; }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.
- (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.Write a program that converts U.S. dollars to Canadian dollars, German marks, and British pounds, as shown in Figure 36.18. The user enters the U.S. dollar amount and the conversion rate, and clicks the Convert button to display the converted amount.3)Write a program which prompts the user for their age. If they are 19 or younger inform them that qualify for student discounts. If they are between 20 and 65 inform them that they qualify for no age discounts. If they are 65 or over inform them that they can receive senior discounts. (solution will be Pyhton code,thank you)4)Write a program from decimal to any base, ask the user for a decimal number and convert entered base by user. (Your program should support bases between 2 and 16 .) (solution will be Pyhton code,thank you)
- Write a program that prompts the user to enter the year and first day of the year, then displays the first day of each month in the year. For example, if the user entered the year 2013, and 2 for Tuesday, January 1, 2013, your program should display the following output: January 1, 2013 is Tuesday ... December 1, 2013 is SundaAn employee is paid at a rate of $16.78 per hour for regular hours worked in a week. Any hours that are paid at the overtime rate of one and one half times that. From the worker’s gross pay 6% is withheld for social security system tax, 14% is withheld for federal income tax, 5% is withheld for state incofor union dues. If thfor health insurance beyond what the employers pays. Write a program that will read 25 employees the number of hours worked in a week and the number of dependents as input, and will then output the worker’s gross pay, each withholding amount and the net take home pay for the week.Problem 2 Write a program that lets the user enter an integer number and display its equivalent value in text form. The range of input values should be from -99999 to 99999. Example 1 Enter integer in range [-99999, 99999] -> 100 Expected Output Text equivalence: one hundred Example 2 Enter integer in range [-99999, 99999] -> 5 Expected Output Text equivalence: five Example 3 Enter integer in range [-99999, 99999] -> 1812 Expected Output Text equivalence: one thousand eight hundred twelve Example 4 Enter integer in range [-99999, 99999] -> 44040 Expected Output Text equivalence: forty-four thousand forty Example 5 Enter integer in range [-99999, 99999] -> -10 Expected Output Text equivalence: negative ten In [40]: