Write a program that prompts the user to input two POSITIVE numbers — a dividend (numerator) and a divisor (denominator). Your program should then divide the numerator by the denominator, and display the quotient followed by the remainder.
Q: Write a program that prompts the user to enter four integersand then displays all possible ways of…
A: Since, here no programming language is specified. So, we are providing the solution in Java. The…
Q: Write a program to read the radian of a circle, check if it is bigger than zero, and if it is to…
A: #include <stdio.h> #define PI 3.14f int main(){float rad,area, perm;printf("Enter radius of…
Q: Write a program that reads a person's first and last names separated by a space, assuming the first…
A: First, we will input first and last name. Then we will replace space with ", ". And finally, print…
Q: Write a program which takes an input from the user, if the input is 1, calculate the area of the…
A: ALGORITHM:- 1. Display the menu. 2. Take input for choice. 3. Take input for various parameters to…
Q: Write a program that prompts the user to enter a three-digit integer and determines whether it is a…
A: JAVA CODE IS GIVEN BELOW:
Q: Write a program that prompts the user to enter the minutes (e.g., 1 billion), and displays the…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED JAVA FOR THE SOLUTION. Define…
Q: Write a program that calculates a “moving (rolling) average” of ten integer numbers entered by the…
A: We need to write a Python code to find moving average.
Q: Write a program that asks the user to enter 2 integers of 4 digits and displays the different digits…
A: Program Explanation: Declare the header files Declare and define the function to compare two…
Q: Write a program that asks the user to guess a random number between 1 and 10. If they guess right,…
A: Program: # initialize the score to 0 score = 0; # the number to guess is 5 number = 5; # run the…
Q: Write a program that reads from the user a number that represents its grade, and then displays a…
A: As no programming language is mentioned, it is solved using basic C++
Q: Write a program that prompts the user to enter an integer and determines it is divisIble by and 6,…
A: Q1: #include<bits/stdc++.h> using namespace std; int main() { cout<<"Enter a…
Q: Write a program that read an integer, and then finds and prints the sum of the even and odd…
A: As per the requirement program is developed. Note : As per our guidelines we are suppose to answer…
Q: Write a program that asks the user to enter a month (1 for January, 2 for February, etc.) and then…
A: Code: #include <iostream> using namespace std;//here is the main functionint main(){ //here…
Q: Write a program to get a random number between 1 and 100, use the button to check whether the given…
A: write a program to get random number between 1 and 100......
Q: Write a program that will ask the user to input a letter 'm' or 'f and then it will display "Hello…
A:
Q: Write a program that checks to see if the user won the lottery. Assume the winning lottery numbers…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Store the given…
Q: Write a program that prompts the user to enter a telephone number expressed in letters and outputs…
A: #include<iostream> using namespace std; int main (){ string inputString, outputString;…
Q: Write a program to prompt the user for their age. Based on their age print out which generation they…
A: If age>21 and age<36 You are generation millennials. Youth ends at 40, old age begins at 59.…
Q: Write a program which prompts the user for a number and prints the numbers from 1 up to that number,…
A: ALGORITHM:- 1. Take the value of n as input from user. 2. Generate the numbers from 1 to the input…
Q: Write a program that asks the user to input 10 numbers and counts how many odd numbers that user…
A: Algorithm:- (I) declare array of size 10. (II) using loop take input . (III) use modulo 2 to…
Q: Write a program that inputs two positive integers of, at most, 20 digits and outputs the sum of the…
A: Actually, program is a executable software that runs on a computer.
Q: Write a program that reads a four-digit number from user, then the program separates digits of the…
A: code
Q: Write a program that takes 7 numbers from the keyboard, count the positive numbers, sum the positive…
A: Below is the required code in C++ language. Approach to Program: Include a necessary header files…
Q: Write a program that asks the user for a number and prints out 100 divided by the number: Enter a…
A:
Q: Write a program that keep asking for a number until you enter a negative number. At the end, print…
A: I give the code in Python because you have not specified any language along with output and code…
Q: Write a program that asks the user for the starting value of their number sequence, and the ending…
A: import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new…
Q: Write a program that prompts the user to enter a three-digit integer and determines whether it is a…
A:
Q: Write a program, which takes an input from the user, if the number is between 90 100, Print A Grade,…
A: Since no programming language is mentioned, I am using python Algorithm: 1. Start 2. Take input…
Q: Write a program that prompts the user to input five decimal numbers. The program should then add the…
A: Since, here no programming language is specified. So, we are providing a solution in C++. the below…
Q: Write a program that reads an integer and displays its first five multiples. For example, if the…
A: #asking for the inputa=int(input("Enter a number : "))#loop for the 5 multiplicantsfor b in…
Q: Write a program that asks the user how many credit units they have taken. If they have taken 23 or…
A: Program Approach: Include the necessary header files for the standard I/O. Declare a user input…
Q: Write a program that prompts and takes an input from a user with values ranging from 4 to 10 and…
A: We need to write a program in python language that display the diamond pattern given in the…
Q: Write a program that mimics a calculator. The program should take as input two integers and the…
A: Since the programming language is not mentioned in the question, we will answer this question in the…
Q: Write a program that prompts the user for an integer and will print a multiplication table up to the…
A: #include <iostream>using namespace std; int main() { int n; cout << "Enter an integer:…
Q: Write a program that takes 7 numbers from the keyboard, count the positive numbers, sum the positive…
A: Below is the required code in C++ language. Approach to Program: Include a necessary header files…
Q: Write a program that will display a table of trigonometric functions: sin x, and tan x for x is from…
A: SOURCE CODE: import math#read degreeprint("{:15}".format("Angle"),end=" ")print("{:10}".format("sin…
Q: Write a program that prompts the user to enter two integer numbers x and y. The program must check…
A: The complete JAVA code is given below with code and output screenshots
Q: Write a program whose inputs are three integers, and whose outputs are the largest of the three…
A: Python code for above: # function to return largest def largest_number(num1, num2, num3):…
Q: Write a program that will ask the user to continuously enter a number until such time that the…
A: I have given c++ code below.
Q: Write a program that prompts the user to input a decimal number and outputs the number rounded to…
A: Program code: //include the required header files #include<iostream> using namespace std;…
Q: Write a simple LMC(little man computer) program that requests the user to input 2 numbers (say, Aand…
A: Program: INP STA M0 INP STA M1 SUB M1 BRP J1 LDA M1 J1 LDA M1…
Q: Write a program to find two points that are nearest to each other. For example, points (1, 1) and…
A: I have added the comments. I have also added the screenshot. The class name is Test. So the commands…
Q: Write a program that takes in an integer in the range 11-100 as input. The output is a countdown…
A: Program Explanation: Import the class for scanner Define a class for countdown Declare and define…
Q: Write a program that asks the user for a number and prints out the factorial of that number.
A: Please find the answer below :
Write a
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.(Program) Write a program to simulate the rolling of two dice. If the total of the two dice is 7 or 11, you win; otherwise, you lose. Embellish this program as much as you like with betting, different odds, different combinations for win or lose, stopping play when you have no money left or reach the house limit, displaying the dice, and so forth. (Hint: Calculate the dots showing on each die with theexpressiondots=(int)(6.0randomnumber+1), where random number is between 0 and 1.)Airline companies apply baggage restrictions for their passengers. An airline company has decided to apply a 10kg limitation for passengers' hand luggage and 20kg for their normal baggage. When passengers arrive, they enter their hand and normal luggage weight from the keyboard. If passengers exceed their normal baggage allowance of 10 dollars per gram, they pay 12 dollars per kg. Accordingly, write the program that calculates the baggage price of the airline they will go to according to the baggage values entered by the arriving passenger and keeps this from closing the program for each passenger. Note: If hand and normal baggage allowances are stretched below the maximum value, the payment amount will be considered not negative. An example printout is given on the right. Geri bildirim gönder
- Write a program that asks the user for two positive integers between 2 and 10 to use for the length and width of a rectangle. If the numbers are different, the larger of the two numbers should be used for the length and the smaller for the width. The program should then display a rectangle of this size on the screen using the character ‘X’. For example, if the user enters either 2 5 or 5 2, the program should display the following:Write a program that asks the user to enter the three sides (a, b and c) of a triangle as double values. Assume that the user will enter three valid sides that can form a triangle, your program should perform the following tasks: If the three sides are equal, the program displays "Equilateral" on the screen. • If any two sides are equal, the program displays "Isosceles". If the sum of the squares of any two sides is equal to the square of the third one, for example (3? + 42 = 5) then the program displays "Right" • Otherwise, the program displays "Scalene" as well as the perimeter of the triangle which is the sum of all three sides. Sample Run 1: Enter three sides: 4.2 4 5 Sample Run 2: Enter three sides: 111 Equilateral Scalene Perimeter of triangle is: 13.2 Sample Run 3: Enter three sides: 3 4 5 Right Sample Run 4: Enter three sides: 8.2 5 8.2 Isosceles 64°FWrite a program that generates a plate number based on the user's answer to the following questions: 1. What is your favorite color of the rainbow (ROYGVIB)? a. Use the first letter of the chosen color as the first character of the plate number. b. Display "Invalid Input" and ask the user to re-enter his/her answer if the answer is not a valid color of the rainbow. 2. What is your month of birth? a. Use the last letter of the month as the second character of the plate number. b. Display "Invalid Input" and ask the user to re-enter his/her answer if the answer is not a valid month. 3. What is your first name? a. Use the third letter of the first name as the third character of the plate number. No need to include the second name if you have a second name. Make sure to use "cout" and "cin" to collect the necessary inputs from the user. For the number section: 1. Ask the user his/her age and use the age as the first and second digits of the plate number. a. Display "Invalid Input" and ask…
- You arrive in front of a bridge that you must cross to reach a village before dark. Crossing the bridge is not free - the bridgekeeper asks you to roll two dice to determine the cost. You decide to write a program to verify that he is charging the right price. Your program should read two integers, between 1 and 6, representing the values of each die. If the sum is greater than or equal to 10, then you must pay a special fee (36 coins). Otherwise, you pay twice the sum of the values of the two dice. Your program must then display the text "Special tax" or "Regular tax" followed by the amount you have to pay on the next line.Given the sample code above in generating a random number. Create a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. 1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Don't display the computer's choice yet.) 2. The user enters his or her choice of "rock", "paper", or "scissors" at the keyboard. (You can use a menu if you prefer.) 13. The computer's choice is displayed. 4. A winner is selected according to the following rules: a. If one player chooses rock and the other player chooses scissors, then rock wins. (The rock smashes the scissors.) b. If one player chooses scissors and the other player chooses paper, then scissor wins. (Scissors cuts paper.) c. If one player chooses paper and the other player…Write a program that reads from the user a character ('q' or 'c'). If the character is 'c', the program reads from the user the radius rof a circle and prints its area. • If the user enters 'q', the program asks the user to enter the length and width of a quadrilateral. We assume the quadrilateral is either a square or rectangle. You should print if the quadrilateral is square or rectangle. • Otherwise, it prints "Wrong character" PS: Use the following formulas: area of circle=3.14*r Sample Run1: Enter a character (q or c): q Enter the Length and Width: 80 150 |It is a rectangle Sample Run2: Enter a character (q or c): q Enter the Length and Width: 80 80 It is a square Sample Run3: Enter a character (q or c): c Enter the radius: 2 The area of the circle is 12.56 Sample Run4: Enter a character (q or c): d Wrong character
- Write a program that asks the user to enter the coordinates of 4 points that draw two different lines. The program has to display whether these two lines are parallel, perpendicular, or neither according to the following formula: Slope = 22-y1 x2-x1 If the slopes of both lines are equal, the two lines are parallel If the product of both slopes is equal to -1, the 2 lines are perpendicular. Otherwise, the two lines are neither parallel nor perpendicular. Sample Run Enter the 4 coordinates of first line: 5.7 8.9 7 7.8 Enter the 4 coordinates of second line: 5.7 7.6 3.5 8.9 The two lines are neither parallel nor perpendicular BUILD SUCCESSFUL (total tine: 36 seconds)Write a program that reads the subtotal and the gratuity rate and computes the gratuity and total. For example, if the user enters 10 for the subtotal and 15% for the gratuity rate, the program displays 1.5 as the gratuity and 11.5 as the total.Write a program that reads from the user a character (*q' or 'c'). If the character is 'c', the program reads from the user the radius r of a circle and prints its area. If the user enters 'q', the program asks the user to enter the length and width of a quadrilateral. We assume the quadrilateral is either a square or rectangle. You should print if the quadrilateral is square or rectangle. Otherwise, it prints "Wrong character" PS: Use the following formulas : area of circle=3.14*r? I