Develop a program to ask the user to enter a number, if the user enters a positive integer, then compute the factorial of that number and display it on the screen.
Q: A movie in a local theater is in great demand. To help a local charity, the theater owner has…
A: PROGRAM STRUCTURE: Include the required header files for the program code: Header file iostream is…
Q: Write a program that reads how much a customer spends on groceries and computes the discount coupon…
A: As no Programming language is mentioned, using Java.
Q: **3.19 (Geometry: point in a circle?) Write a program that prompts the user to enter a point (x, y)…
A: Step-1: StartStep-2: Declare variable x, y, distanceStep-3: Calculate distance by using square root…
Q: ach trial, you have to inform the user, either he/she has guessed it correctly or not, and the…
A: //Source code in python import random import math //Taking inputs lower=int (input("Enter Lower…
Q: Write a program which reads two integer values. If the first is less than the second, print the…
A: Here I have declared 2 variables num1 and num2 of integer data type. Next, I have taken input from…
Q: Write a program that prompts the user to enter the number of hours a car is parked at the airport…
A: Assuming the formula, Parking fee, F is calculated as 5, 0 ≤ h ≤3F = {6 ×int (h+1),…
Q: (Geometry: great circle distance) The great circle distance is the distance between two points on…
A: The Java program is written where it takes the latitude and longitude degrees from the user for the…
Q: Guess-the-number-game: Write a program that pays the game of “guess the number” as follows: Your…
A: Since the programming language is not mentioned in the question, we will answer this question in the…
Q: Questions) Q1 / write a program to find the area of a triangle with a suitable design.
A: As per the policy of Bartleby we can answer only the first question, please ask the other questions…
Q: Suppose you want to deposit a certain amount of money into a savings account with a fixed annual…
A: The first three steps are to get the inputs from the user which are the annual interest rate Number…
Q: Write a program that calculates and displays a person’s body mass index (BMI). The BMI is often used…
A: C++ Program: #include <iostream>#include <cmath> // Included for using pow()…
Q: remember, some companies use letters to show their telephone number. For example, the telephine…
A: //Use "stdafx.h" only, if using visual studio. #include "stdafx.h" // Declare necessary header…
Q: The owners of the Annan Supermarket would like to have a program that computes the weekly gross pay…
A: Define the class Employee with data members as pay rate for hour, hours worked, first name and last…
Q: A parking garage charges a $2.00 minimum fee to park for up to three hours and an additional $0.50…
A: Program for the given problem :- #include <stdio.h> float getCharge(float hours){ float…
Q: Write a program in which user is asked to enter two integers (divisor and dividend) and computes the…
A: Program Explanation :- In this Program, the user is required to enter two numbers (separator and…
Q: The great circle distance is the distance betweentwo points on the surface of a sphere. Let (x1, y1)…
A: Note: Programming language is missing in the question. So we will answer this program in Java…
Q: A county collects property takes on the assessment value of property, which is 60 percent of the…
A: Since the coding language is not mentioned, I have done the code in C++. Algorithm : Step 1 :…
Q: A savings account is opened with £100000 at the beginning of January. A deposit is then made of…
A: As the programming language is not mentioned here, we will be using PYTHON The complete code is…
Q: The first executable statement in the program is a printf, requesting the user to enter an integer…
A: The printf function is the prints a string on the screen using a “format string”.
Q: Write a program that will accept the student's name. The program holds 20 names of students. The…
A: 1- In this assignment, I have used the struct keyword, struct is the blueprint of the class both are…
Q: can you please write it in java.util.scanner form Write a program that prompts the user to enter a…
A: PROGRAM CODE: import java.util.*; // import the java utility…
Q: Write a Program to enter the numbers till the user wants and at the end it should display the count…
A: Code :
Q: Exercise 1 Write an application that displays the numbers 1 to 4 on the same line, with each pair of…
A: GIVEN:
Q: Q1) Write the pseudocode for the following. a. Ask a user to enter a number. If the number is…
A: Pseudo codes are way to write an algorithm without using the specific features of a particular…
Q: Write a program that displays a simulated paycheck. The program should ask the user to enter the…
A: Define header file <iostream>, <cstring> , <string> and <iomanip>. Define…
Q: The following code intends to input a user’s first name, last name, and age.However, it has an…
A: Corrected Code: #include <iostream>#include <string.h>using namespace std; int main(){…
Q: TotalPayAA.java Write a program that will calculate an employee’s total pay for a week (hourly pay…
A: Program Approach: Import necessary packages for scanning Input create a class TotalPay and Define…
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: Assume you are a college professor and have to average grades for 10 students. Write a program that…
A: Step-1: Start Step-2: Declare an array arr of size 10 Step-3: Declare two variables sum and avg…
Q: Create a program using switch statements that will ask the user to input an intege
A: Program: <?php// prompt for number$t = (int)readline('Enter an integer: ');// define switch…
Q: Create a program, mintosec.py, that takes one integer argument representing a number of minutes. The…
A: The code is below in python language:
Q: Assume that a runner runs 15 kilometers in 50 minutes and 30 seconds. Write a program that displays…
A: #include<iostream> using namespace std; int main(){ int distanceTravelledInKMS=15;…
Q: (usually shown by a hand gesture) at the same time, and a winner is determined. In the game, Rock…
A: Code: import java.util.Scanner; public class Main { static Scanner scanner = new…
Q: Question 7
A: Following is the C++ program and its approach is given below: Declare necessary header files.…
Q: Show what the program segment would display on the screen. int x = 2;…
A: Please find the answer below :
Q: Write a program that calculates and displays a person’s body mass index (BMI). The BMI is often used…
A: Let's see the solution in the steps
Q: C++ coding In order to paint a wall that has a number of windows, we want to know its area. Each…
A:
Q: 1-Write a program that will ask the user to enter an integer number and display the (even and…
A: here in this question we have asked to write a program which take an input integer and based on this…
Q: Write a program that prompts the user to input their names and age and then displays your name and…
A: I have given an answer in step 2.
Q: A software company sells a package that retails for $99. Quantity discounts are given according to…
A: Programming instructions: Include necessary header files. Create a class. In the main, create the…
Q: Write a program (use value returning method) that gives simple math quizzes. The program should…
A: Given: Write a program (use value returning method) that gives simple math quizzes. The program…
Q: [Question Description] Enter any number of integers with three digits and determine whether they are…
A: Below is the complete solution with explanation in detail for the given question about palindrome.…
Q: Write a program in python that asks the user to enter a word and then capitalizes every other letter…
A: PROGRAM CODE: st = input("Enter the string: ") // take original string from…
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: 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: 2. The following table contains earthquake magnitude ranges on the Richter scale and their…
A: The programming methodology is given by: Including header files Main function Declaring magnitude…
Q: KEMBOJA Hospital provides top-notched medical care with comfortable rooms. The following are the…
A: Note : as per company guidelines we are supposed to answer only first 3-sub parts . please repost…
Q: Write a program that prompts the user to enter a nonnegative integer and outputs the factorial of…
A: Approach To calculate factorial of any non-negative number, we can use either loop (for or while) or…
Q: Use Language: C Write a program that accepts a number and determines whether the number is…
A: Algorithm: if condition then something if; elseif condition then…
Q: Write a program that prompts the user to enter the edges of a triangle and compares them. If all…
A: In the solution of given problem, we need to use Else-If ladder statement to test the conditions. An…
Step by step
Solved in 4 steps with 2 images
- pthyon: Write a program to allow the user to enter five numbers, one at a time. After each entry, tell the user whether the number is odd or even. At the end of all the entries, display the sum total of all the entered numbers on the screen.Time CalculatorWrite a program that asks the user to enter a number of seconds.-There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60, the program should display the number of minutes and leftover seconds in that many seconds.-There are 3,600 seconds in an hour. If the number of seconds entered by the user is greater than or equal to 3,600, the program should display the number of hours, minutes, and leftover seconds in that many seconds.-There are 86,400 seconds in a day. If the number of seconds entered by the user is greater than or equal to 86,400, the program should display the number of days, hours, minutes, and leftover seconds in that many seconds.An online book club awards points to its customers based on the number of books purchased each month. Points are awarded as follows: Books Purchased Points Earned 1 5 2 15 3 30 4 or more 60 Write a program that asks the user to enter the number of books purchased this month and then displays the number of points awarded.
- Microwaves / Radio Waves If a scientist knows the wavelength of an electromagnetic wave she can determine what type of radiation it is. Write a program that asks for the wavelength in meters of an electromagnetic wave and then displays what that wave is according to the following chart. (For example, a wave with a wavelength of 1E-10 meters would be an X-ray.) 1x 10-11 1 x 10-8 4 x 10-7 7x 10-7 1x 10-3 1 x 10-2 Gamma Rays. X Rays Ultraviolet Visible Light Infrared3. Random Symbol Guessing Game Write a program that generates a random symbol and asks the user to guess what the symbol is. If the user's guess has a higher ASCII number than the random symbol, the program should display "Symbol ASCII too high, try again." If the user's guess has a lower ASCII number than the random symbol, the program should display "Symbol's ASCII too low, try again." The program should use a loop that repeats until the user correctly guesses the random symbol.Party-On sells individual hot/cold cups and dessert plates for parties. SueChen wants a program that allows her to enter the price of a cup, the price of a plate, the number of cups purchased, and the number of plates purchased. The program should then calculate the total cost of the purchase, including the sales tax. Finally, the program should display the total cost on the screen. Desk-check your solution’s algorithm using $0.50 as the cup price, $1 as the plate price, 35 as the number of cups, 35 as the number of plates, and 2% as the tax rate. Then desk-check it using $0.25, $0.75, 20, 10, and 6%.
- 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.Computer Science PYTHON PROGRAMMING Write a program that generates a random number in the range of 1 through 100, and asks the user to guess what the number is. If the user's guess is higher than the randomly generated number, the program should display "Too high, try again." If the user's guess is lower, the program prints "Too low, try again." If the user guesses the number, the application should congratulate the user and generate a new random number so the game can start over. Keep track of the number of guesses a user makes before guessing the correct one and display it with the congratulatory message when the user guesses the number correctly. For this assignment, create functions that: generate and return a random number between 1 and 100. format and return the failure and congratulatory messages. Put these function in a module called helper.py and put the rest of the code in game.py. The game module must import the helper module. Please provide both helper.py & game.py…Retail price calculator Write a program that asks the user to enter an item’s wholesale cost and its markup percentage. It should then display the item’s retail price. For example: • If an item’s wholesale cost is 5.00 and its markup percentage is 100 percent, then the item’s retail price is 10.00.• If an item’s wholesale cost is 5.00 and its markup percentage is 50 percent, then the item’s retail price is 7.50. The program should have a method named calculateRetail that receives the wholesale cost and the markup percentage as arguments and returns the retail price of the item.
- Box Office: A movie theater only keeps a percentage (20%) of the revenue earned from ticket sales. The remainder goes to the movie distributor. Write a program that calculates a theater’s gross and net box office profit for a night. The program should ask for the name of the movie, and how many adult and child tickets were sold. (The price of an adult ticket is $10.00 and a child’s ticket is $6.00.) Input: the name of the movie, number of adult tickets sold, number of child tickets sold Output: as specified below Object: cin, cout, getline, format output Note: 1. Movie names contain spaces 2, the report is aligned. 3. The decimal number is displayed with 2 decimal places.Remaining Time: 1 hour, 14 minutes, 07 seconds. Question Completion Status: QUESTION 11 Write a Java program that prompts the user to enter the monthly salary amount of an employee in OMR and then deduct a 29% amount as a provident fund from the monthly salary. Calculate, a. Monthly deduction amount = Monthly Salary Amount * percentage of deduction b. Monthly Net salary amount = Monthly Salary Amount – Monthly Deduction amount c. Calculate and display the Annual Net salary amount in OMR and Annual deduction amount in OMR. T T T Arial v 3 (12pt) 回i ン Save All A TOSHIBA 10Using C# in Microsoft Visual Studio create an application 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 is2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Do not display the computer’s choice yet.)2. The user selects his or her choice of rock, paper, or scissors. To get this input you can use Button controls, or clickable PictureBox controls displaying some of the artwork that you will find in the student sample files.3. The computer’s choice is displayed.4. A winner is selected according to the following rules:• If one player chooses rock and the other player chooses scissors, then rock wins. (Rock smashes scissors.)• If one player chooses scissors and the other player chooses paper, then scissors wins. (Scissors…