Case 1: Input: 5.1, 5.1, 5.1, 5.1, 5.1. Expected Output: 26.
Q: Write a program that reads in a number N and then output of the numbers from 1 to N. If the input is…
A: Define header file <iostream> for io operations. Define function func with parameter n. Define…
Q: Pyhton program that performs the following operations by reading the weight of athletes until a zero…
A: weight = Nonewhile weight!= 0: a_weight = input("Enter the weight of athletes (0 terminates): ")…
Q: Write a program that prompts the user toenter the year and first day of the year, then displays the…
A: PROGRAM EXPLANATION: - Three static []s are declared and initialized for names of months, days in…
Q: Write a program that picks four cards from a deck of 52 cards and computes their sum. An ace, king,…
A: program plan: Write a program that picks four cards from a deck of 52 cards computes their sum with…
Q: Write a program that calculates the potential energy of 3 charges q1 = 1, q2 = 2, q3 = 3 located at…
A: For the given points (1, 2, 3), (3, -4, -5) and (-4, 2, -6) The rij is the distance between charges…
Q: Write a C++ program that generates a plate number based on the user’s answer to the following…
A: Step 1 : Start Step 2 : In the main function, declare and initialize the number plate string with…
Q: Write a program that will ask a user to input grades in Integral Calculus, Computer Programming and…
A: The given code is in Python.
Q: write a program in VB that requires from user to insert the total number of students and the number…
A: ' Program that reads total student and successful student and calculate' and display percentage of…
Q: Write a program that reads from the user the initial KiloMeters of the car, the current KiloMeters,…
A: Answer
Q: a * (b - c / d) + ++ Num2 where a, b, c and d are float type variables. b) Write a program that…
A: The solutions for the given three scenarios is being explained in the below steps which is being…
Q: Write a program that does temperature converter :\n", "- The user will enter if he wants the result…
A: As per the requirement program developed. Note: In the question programming language is not…
Q: Write a program with total change amount in pennies as an integer input, and output the change using…
A: Actually, 000Java is a programming language originally developed by James Gosling at Sun…
Q: Write a program that reads a non-negative number n from the standard input and prints the value of…
A: Algorithm Initialize a variable "a" and please check about special case i.e. for 0 and 1. Run a…
Q: Let's modify the program from this section so that the user can supply the interest rate. For very…
A: Step 1: Declare a constant to store initial balance. Step 2: Declare and initialize year to be 0.…
Q: Write a program that automates the table used by a surveyor to transform compass headings in degrees…
A: compass_heading=float(input("Please enter the Compass heading in Degrees from 0 to 360: "))…
Q: Write a program that reads an arbitrary number of integers that are in the range 0 to 50 inclusive…
A: ## As no programming language mentioned, the code is written in Python. f_dict = {}…
Q: Write a program to read two integers with the following significance. The first integer value…
A: Required: Write a program to read two integers with the following significance. The first integer…
Q: Write a program that asks the user the number of hours an employee worked and his hourly wage,…
A: #include <iostream>using namespace std; int main() { int hours=0,wage=0; double…
Q: Write a program with total change amount as an integer input, and output the change using the fewest…
A: Lets see the solution.
Q: Write a program that reads two integers, a and b, from the user. Where a is equal to 17 and b is…
A: Note: Below is the required program in the python language. Program Approach: Ask the user to enter…
Q: Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D,…
A: Program that translates a letter grade into a number grade. Algorithm: Start Input a letter…
Q: Write a program that determines an integer value the user had in mind. Your program first asks the…
A: def startGame(l, u): while l != u: number = (l + u) // 2 print("Is the number…
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 that reads two integer values from the user and then prints the Greatest Common…
A: We know that gcd of two number is (a*b)/LCM(a,b), where a and b is given number.
Q: Write a program that begins by reading a number of cents from the users as an integer (this is input…
A: In the Python 3 programming language, set all needed currency named variables to 0 to make floor…
Q: Write a program that reads an integer between 0 and 1000 and multiplies all the digits in the…
A: SINCE NO PROGRAMMING LANGUAGE WAS MENTIONED, THIS CODE IS WRITTEN IN PYTHON.
Q: Solve in Python: Write a program that creates a login name for a user, given the user's first name,…
A: Here I have taken input from the user and stored it into 3 different variables. Next, I have…
Q: 13. Write a program that lets the user play Rock-Paper-Scissors against the computer. There should…
A: Since no programming language is mentioned, I am using python Algorithm: Start Read input from user…
Q: A. Write a program in "SUM.C" which reads two integers and prints out the sum, the difference and…
A: To do: Find sum, difference, product, division and remainder of two numbers. The program ask user to…
Q: Write a program that reads an integer value from the user rep- resenting a year. The purpose of the…
A: A leap year is denoted as a year in which there are 29 days in the month February and also it comes…
Q: Using function calls, write a program to spell out the word MISSISSIPPI using block letters like the…
A: PROGRAM CODE: public class Main{ public static void main(String[] args) { printM(); printI();…
Q: make this into a problem: Here we have implemented the program that displays whether the user input…
A: Note:- always mention programming language name. This program is done using c++. logic:- read A, B…
Q: Write a program that displays the classic BINGO game, displays a BINGO card (5x5 square), and tests…
A: Given data is shown below: Write a program that displays the classic BINGO game, displays a BINGO…
Q: (B) Write a program that reads from the user the values of x and h to implement the equation below.…
A: Code: #include <iostream>#include<cmath>using namespace std;int main(){ //declaring…
Q: gram in C that displays the classic BINGO game, displays a BINGO card (5x5 square), and tests the…
A: Write a program in C that displays the classic BINGO game, displays a BINGO card (5x5 square), and…
Q: Write a program which repeatedly reads numbers until the user enters "done". Once "done" is entered,…
A: As per the question statement, We will run this code and try out different input value and will…
Q: This java program outputs a downwards facing arrow composed of a rectangle and a right triangle. The…
A: PROGRAM CODE: // import required libariesimport java.util.*;public class Main{ // start…
Q: . Write a c++ program that tells what coins to give out for any amount of change from 1 cent to 99…
A: Programming instructions: Declare the required variables. Use a do-while loop that allows the user…
Q: Write a program that will ask a user to input grades in Integral Calculus, Computer Programming and…
A: Given Code : integral_calc = float(input('Input your grade in Integral Calculus: '))phys =…
Q: Write an improved version of the chaos . py program from Chapter 1 thatallows a user to input two…
A: Lets see the solution.
Q: There are n players, and counting always starts with the folded hands of player 1. For instance, in…
A: Java Program: // Importing required modules import java.util.Scanner; import java.util.LinkedList;…
Q: 2. Write a complete program that prompts the user for a test score and prints out the letter score…
A: //2import java.util.Scanner;//to reading input from userpublic class Main{ public static void…
Q: Write a program that creates a login name for a user, given the user's first name, last name, and a…
A:
Q: Write a program that plays a reverse guessing game with the user. The user thinks of a number…
A: import util class for Random class. For generating random number use-n = rand.nextInt((high - low) +…
Q: Write a program that reads from the user the initial KiloMeters of the car, the current KiloMeters,…
A: Step-1: Start Step-2: Declare variable currentKm, initialKM, fuelAmount and fuelConsumption Step-3:…
Q: Write a program that reads from the user a character ('s' or 'a'). • If the character is 's', the…
A: As no programming language is mentioned, it is solved using basic C++
Q: Given the following code, what initial values for num will cause an error during execution? int…
A: Given:
Q: Write a program that reads three numbers and prints "increasing" if they are in increasing…
A: According to the question: Write a program that reads three numbers and prints "increasing" if they…
Q: Write a program that takes user input describing a playing card with the following shorthand: A =…
A: When we consider a C++program, it can be defined as a collection of objects that communicate via…
Q: Write a program that begins by reading a number of cents from the users as an integer (this is input…
A: Initialize all required currency named variable with 0 in python3 programming language so that the…
Q: Implement a python version of the game Hangman in which a player attempts to guess a secret word one…
A: Solution:-- 1)The given question has required for the solution which is to be provided as the…
Q: Write a program that generates a plate number based on the user's answer to the following questions:…
A: PROGRAM EXPLANATION Include the header file. Define the main function. Create variables for input…
Q: a program that reads from the user two integers of three digits each The program finds the sum of…
A: import java.util.Scanner;public class MyClass { public static void main(String args[]) {…
Q: Write a program which reads two integers and prints out the sum, the difference and the product.…
A: As per guidelines we are supposed to answer only one question. Kindly repost other questions as a…
Write a
five decimal numbers, convert the sum to the nearest integer, and print the result. Use the static_cast
statement with an appropriate equation to convert the sum to an integer. Compile and run your
program with the following test data:
Case 1: Input: 5.1, 5.1, 5.1, 5.1, 5.1. Expected Output: 26.
Case 2: Input: 5.0, 5.0, 5.0, 5.0, 5.0. Expected Output: 25.
The language is C++
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images
- Hi, I need help with the following assignment. Implement a program that reads in a year and outputs the approximate value of a Ferrari 250 GTO in that year. Use the following table that describes the estimated value of a GTO at different times since 1962. Year Value 1962-1964 $18,500 1965-1968 $6,000 1969-1971 $12,000 1972-1975 $48,000 1976-1980 $200,000 1981-1985 $650,000 1986-2012 $35,000,000 2013-2014 $52,000,000Write a program that take 5 digit number as an input from the user and perform the following tasks:1. Split a number into digits.2. Find the sum of the all the digits in the number.3. Find the product of the all the digits in the number.4. Find maximum number with in the number along with position.5. Printing the digits in the reverse order.Note: Make user defined functions to perform each task.Write a tester program that counts and displays the number of iterations of the following loop: while problemSize > 0:problemSize = problemSize // 2 After you have write the code. Run the program you created using problem sizes of 1000, 2000, 4000, 10,000, and 100,000. As the problem size doubles or increases by a factor of 10, what happens to the number of iterations?
- 3. Write a program that picks a random number between 1 and 100 inclusive. It then prompts the user to guess the number. If the user guesses the number, print out a congratulatory message and exit. Otherwise, indicate whether the guess was low or high and ask the user to try again. Hint: Use the rand() function.PROBLEM:Write a program that prompts the user to input any digit then swap the position of the first and the last digit. Next, the user will be prompt to select what arithmetic operation he/she want to employ on the first and last digit based on the following choices: 1. Sum of their square 2. Product of their square root 3. Square of their product The output will display the result of the arithmetic operation followed by the digit with a swapped position of “first” and “last” digit. Then finally display the equivalent uppercase alphabet for the first digit and lowercase alphabet for the last digit respectively after swapping. Note: 1. If the last digit of the inputted digit from the user is zero, it must display that there is no equivalent alphabet for that digit. 2. If the user chooses arithmetic operation No.2, format the output to three decimal placesWrite the following function to draw a regular polygon:def drawPolygon(x = 0, y = 0, radius = 50, numberOfSides = 3):The polygon is centered at (x, y) with a specified radius for the bounding circle for the polygon and the number of sides. Write a test program that displays a triangle, square, pentagon, hexagon, heptagon, and octagon, as shown in Figure 6.12a.
- f. A laborant in a laboratory does a number of antigen tests in one day. Write a program that simulates the number of antigen tests done in a day in a laboratory, displays the number of positives and negatives, and calculates the % of positives in one day. Your program needs to first generate a random number that will show the number of tests done in a day. One laboratory in a day cannot do more than 100 tests and less than 1 (they do at least one). Then for each of the tests, your program needs to generate a random number to show whether they are positive or negative. In order to write this program, you need to have the following three functions used by the main function: test result (void): This function generates a test result. It should randomly return either one or zero. 1 means positive test result and 0 means negative test result. float positive percentage (int,int) : This function takes the total number of positives and the total number of tests and returns the % of positives.…1. Write a program called NumberGuess to play the number guessing game. The program shall generate a random number between 0 and 99. The player inputs his/her guess, and the program shall respond with "Try higher", "Try lower" or "You got it in n trials" accordingly.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
- Program 2: Write a program that asks the user for a word or phrase. Check to see if it is a palindrome. A palindrome is a word that is spelled exactly the same forward and backwards such as radar or noon. Your program must also take case into account. If the user types Radar, it must still return that it is a palindrome. Do not worry about palindromes with spaces. You do not need to put any code in static methods, you do not need to worry about try/catch blocks, and you do not need to make the program run more than once. Test values that I will use in class: Noon palindrome tacocat palindrome Hello not a palindrome in javaTask 9 Write Python code of a program that reads an integer, and prints the integer if it is a multiple of NEITHER 2 NOR 5. For example, 1, 3, 7, 9, 11, 13, 17, 19, 21, 23, 27, 29, 31, 33, 37, 39 ... hint(1): use the modulus (%) operator for checking the divisibility hint(2): You can consider the number to be an integer !%3%===== Example01: Input: 3 Output: 3Statistics are often calculated with varying amounts of input data. Write a program that prompts for and takes any number of non-negative integers as input, and outputs the average and max. A negative integer ends the input and is not included in the statistics. Example program run (the user types only the numbers, in this case 15 20 0 5 -1): Enter numbers separated by spaces, with a negative number to quit: 15 20 0 5 -1 Average = 10 Max = 20 #include <iostream>using namespace std;/* program that prompts for and takes any number of non-negative integers as input, and outputs the average and max. A negative integer ends the input and is not included in the statistics. Example program run (the user types only the numbers, in this case 15 20 0 5 -1): Enter numbers separated by spaces, with a negative number to quit:15 20 0 5 -1 Average = 10 Max = 20*/ int main() { /* Type your code here. */ return 0;}