• Write a program that computes the average of 5 students grades which are entered by the user. Write a program that converts pounds into kilograms. The program prompts the user to enter a number in pounds, converts it to kilograms, and displays the result. One pound is 0.454 kilograms.
Q: Write a program for The Carefree Resort named ResortPrices that prompts the user to enter the number…
A: C# is a general purpose multi-paradigm programming language developed and used by Microsoft. It…
Q: 7. Write a program that keeps reading values from the user until the user enters a negative value,…
A: The Answer is in given below steps The code is in c language
Q: Write a program that converts pounds into kilograms. The program prompts the user to enter a value…
A: PROGRAMimport java.util.Scanner;public class Shubham { public static Void main(string[] args) {…
Q: Q1. Write a program that takes a range from the user and display all the even numbers between the…
A: /* C++ program to print the even numbers within the given range */ #include…
Q: 3. Write a program that plays a guessing game with the user. The program should generate a random…
A: According to the information given:- We have to follow the instruction in order to create guess game…
Q: Q1: Write a program that reads 10 numbers and then finds the largest number and prints it and finds…
A: - The question wants us to find the largest and smallest number after reading 10 numbers and print…
Q: 6. A microwave oven manufacturer recommends that when heating two items, add 50% to the heating…
A: Hey, since multiple questions posted, we will answer first question according to our policy. If you…
Q: Write a program that reads from a student his/her name and his/her ID which is formed of 8 digits.…
A: The solution to the given problem is below. **Note: As programing language is not mentioned in the…
Q: Assume that int a[ 2 ][ 2 ] = { { 1, 2 }, { 3, 4 } }; the value of a[ 1, 1 ] = ______;
A: #include<stdio.h> int main(){ int i=0,j=0; int arr[2][2]={{1,2},{3,4}};…
Q: 2. Write a console program that reads in an input for value (int) and computes (using mod) if value…
A: We need to read numbers continuously until the user enters a sentinel (0 we choose). The code is…
Q: What is the output of this code? int a = 5, b = 4, c= 1; cout << (a < b && b < c);
A: According to the question its check a<b which is false so it return 0 b<c which is false so it…
Q: 2. Write a program that will read a number and will display the factors of the number. Factors are…
A: As per our guidelines we are supposed to answer only one question. Kindly repost the remaining…
Q: C++ In this task, you are required to write a code that converts an Octal number into its…
A: Choice 1 is followed by inserting an Octal integer and getting its Decimal equivalent value as an…
Q: Void Do1 (int: &, a. int &b) { a = 5; a = a + b; b = a + 2; } Int main() {…
A: We have given a C++ code and in which pass variable by reference. Here, integer variable x pass by…
Q: 3. Write a program that displays the following pattern: ***** *** * *** *****
A: As no programming language is mentioned, it is solved using basic C++
Q: Implement a program that reads in a year and outputs the approximate value of a Ferrari 250 GTO in…
A: According to the information given:- We have to follow the table and Implement a program that reads…
Q: Exercise 3: Write a java program that keeps asking the user to enter a set of integers until…
A: The following approach is to be followed: Import necessary java libraries and headers. Create a…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both…
A: Program code: //include the required header file #include <iostream> #include…
Q: (b) Below is part of a code, consider this program and show where each part of code is saved in the…
A: Given: Below is the part of a code , Consider this program and show where each part of code is…
Q: 1- Write a java program that asks the user to input two integers intStart and intEnd then computes…
A: 1) read start and end value 2)Iterate n from 10 to 100 with step size 10 3)in above loop, For…
Q: 3. Write a program that computes and interprets the Body Mass Index (BMI). The program prompts the…
A: Take two inputs from user for height and weight convert height in meter(h*0.0254) and weight in…
Q: 8. Write and run a program that reads the user's age and then prints "You are a child." if the age <…
A: As Bartleby guidelines i can solve one question at a time so please post another question again.…
Q: 9) Write a program that takes in the user's name and age. Then displays his/her name's initial…
A: #include<iostream> using namespace std; int main() // main function { string name,…
Q: Task5. Write a program that prints the following output :
A: Given: please use java to answer the following question
Q: Write a program that, given the time duration of a task in the number of hours, minutes, and…
A: I have provided c++ code in step2
Q: Federal law requires that hourly employees be paid “time-and-a-half” for work in excess of 40 hours…
A: workingHours=float(input("Enter number of working hours: ")); #input working…
Q: in this program. a, int b, int *c, int *d, int *resu a, int *b, int *c, int *d, int *resu int *res
A: I have written the code below:
Q: Find out the final values of a,b and c where following expressions are executed sequentially:[4] int…
A: Here in this question we have given a code fragment.and we have asked to find the final value of a…
Q: 2. Write a program with a user interface which allows the user to enter 2 integers. It should then…
A: Program to perform addition, subtraction, multiplication and division on two input numbers in Python
Q: 4.Write a program that displays a Pascal triangle. The program prompts the user to enter the number…
A: The answer is in below steps:
Q: Problem 7: Guess the price of the car!? You will implement a variant of the number guessing game we…
A: Python used to answer this question
Q: what will the following code segment print on the screen? int a,x=23; a=x+2;…
A: The variable "a" is declared as "int" type. The variable "x" is initialized to the integer value…
Q: What will be the values of the variables a, b and c after executing the following code? int a: int…
A: Answer in step2
Q: 3. A certain CS professor gives 100-point exams that are graded on the scale 90-100:A, 80–89:B,…
A: Ans: Code: score = int(input("Enter the exam score:"))if score > 90 and score < 100:…
Q: Q7) Write program, to allow the user to enter integer number, and find the square and cubic of the…
A: /*C program which allow the user to enter integer number, and find the square and cubic of the…
Q: Write a program that converts pounds into kilograms. The program prompts the user to enter a value…
A: Lets see the solution.
Q: 8. Write a program that will compute delivery charges based on weight Weight Up to 100 lb Charge per…
A: A program is as follows, Code: %Get the input from the user weight=input('Please enter weight of…
Q: QUESTION 2 Write a program that prints out the following pattern **** **** **** ****
A: Required: C++
Q: Q1/ Write a program that reads from the user the number of students in the class and their grades i…
A: Code:Specific language is not mentioned so i am giving the code in c++ langauge: #include…
Q: Exercise : Make a program that takes 5 test scores from the user, calculate the average Score and…
A: According to the Question below the Solution: Output:
Q: 2.3 Write a Java program that randomly generates three integer numbers between 0-150. Then,…
A: import java.util.*;public class Main{ public static void main(String[] args) { Random rand= new…
Q: 6. infave = Given the following code segment, what is the output? int x = 1, y = 1, z = 1; %3D Y - y…
A: Given: x=1, y=1,z=1 y=y+z y=2 x=x+y x=1+2 x=3
Q: A county collects property taxes on the assessed value of property, which is 60 percent of its…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner…
Q: 3. Write a program that computes and interprets the Body Mass Index (BMI). The program prompts the…
A: Prompt to enter the weight in pounds. Store the value in a variable. Prompt to enter the height in…
Q: 7) Write a program that asks the user the number of hours an employee worked and his hourly wage,…
A: code:-- #include <iostream>using namespace std; int main(){ // to store the total_hour and…
Q: a) Write a program that defines variables a, b, c, d as float and Num2 as integer. Solve the…
A: The program is a simple arithmetic operation using variables and different data types. Variables…
Q: C# Write a program for The Carefree Resort named ResortPrices that prompts the user to enter the…
A: Algorithm: Start Read enter the number of days for a resort stay n If n==1 or n==2,calculate cost…
Q: 6) Write a program that prompts the user to input a number. The program should then output the…
A: According to the asked question, the solution is given below with a proper explanation.
Q: E2.7 Write a program that prompts the user for a radius and then prints • The area and circumference…
A: We are going to take radius as input from the user and then we will find out area of the circle,…
in Java language
Step by step
Solved in 2 steps with 2 images
- 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.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; }السبت ۲ أكتوبر المحاولة رقم 1 :2 HW • Write a program that computes the average of 5 students grades which are entered by the user. Write a program that converts pounds into kilograms. The program prompts the user to enter a number in pounds, converts it to kilograms, and displays the result. One pound is 0.454 kilograms. محتوى إضافي؟ يمكنك إضافة نص وملفات تدعم إجاباتك. إضافة محتوی إرسال الحفظ لوقت لاحق
- 1. Write a program that lets the user guess whether a randomly generated integer would be even or odd. The program randomly generates an integer and divides it by 2. The integer is even if the remainder is 0, otherwise odd. The program prompts the user to enter a guess and reports whether the guess is correct or incorrect.Lab Write a complete program that: 1. Prompts the user to enter an integer and reads in an integer number from the keyboard. 2. Prompts the user to enter a second integer and reads in a second integer number from the keyboard. Adds the integer from (1) to the integer from (2) 3. 4. Subtracts the integer from (2) from the integer from (1) 5. Multiplies the integer from (1) to the integer from (2). 6. Divides the integer from (1) by the integer from (2) 7. Modulus the integer from (1) by the integer from (2) 8. Prompts the user to enter a double and reads in a double number from the keyboard. 9. Prompts the user to enter a second double and reads in a second double number from the keyboard. 10. Divides the double from (8) by the double from (9) 11. Writes the answers from (3)-(7) and (10) out to the display The user should be prompted to enter the input values and the result of the arithmetic should be output. Example Output An example of an interaction with your program is shown below,…1. Write a an algorithm that asks the user to input a positive integer n and counts how many of the squares of the integers from 1 to n end in a 1.2. Write a an algorithm that asks the user to input a positive integer n and counts how many of the squares of the integers from 1 to n end in a 4 and how many end in a 9.
- • Write a program that will compute the students average • The user will input the following: Name Math Science English • If the average is equal and above 75, it will display “Congratulations. You passed the semester” otherwise “You failed the semester.” • However, if his average is equal and above 75 but fail to pass one or two subjects, it will display “Congratulations. You passed the semester. But you need to re-enroll (subject name) subject." Binary-Decimal / Decimal Binary . Between 0 and 255 a number will be decided randomly by computer. Then asks to user 3 times a random digit of binary value of the that number. If user enters wrong number for a digit program will select another random number and ask random times random digit. Every time user enters input will be counted as one hour in that planet. For example: Computer selected number as 163 ( Which is 10100011) What is the digit 2 (question 1/3) :User enter 1 CorrectWhat is the digit 4 (question 2/3) : User enter 0 CorrectWhat is the digit 7 (question 3/3) : User enter 0 CorrectUser finished the quest with 3 input .5- Write a program which read a number consists of 4 digits and find the maximum digit of the number. FOR eg. 1472 the maximum digit is 7 the maximum digit is 9 9835
- Q1: Write a program that reads 10 numbers and then finds the largest number and prints it and finds the smallest number and eyChallenge Problem python G U E S S T H E N UM B E R Write a program that plays a guessing game with the user. The program should have the right answer set to 13, then prompt the user repeatedly to guess the number from 1 to 25. When the user guesses incorrectly, the game should give the user a hint about whether the correct answer is higher or lower than the guess. Once the user guesses correctly, the program should print a message showing the number of guesses that the user made. Note : This assignment involves the use of a while loop and if-else decision making controls. You CANNOT use the reserved keywords break and continue for any portion of this program or any program for that matter throughout this course.Questions 1. Write a program which asks the user to enter a six-digit number and print a new number by subtracting 1 to each of its digits. For example, if the number entered is 393201, the output should be displayed as 282190. Information on the console should be displayed similar to the Sample Run shown below. Sample Run: Enter a 6 digit number: 393201 Modified number is: 28219d