Write a program that asks the user to enter two integers: n1 and n2 and prints the sum of all numbers from n1 to n2. For example, if the user enters n1=3 and n2=7, then the program should display the sum as 25.
Q: Write a program that asks the user for the number of adult and the number of child movie tickets…
A: Answer :- #include <iostream> #include <iomanip> using namespace std; int main() {…
Q: Q#1: Write a program that prints the numbers from 1 to 1000 On the same line it should also print…
A: Program plan: Create a function name printSquare() loop from i=1 to 1000 print(str(i)+". Squared…
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: Write a program that prompts the user to enter three cities and displays them in ascending order.
A: #include<iostream>#include<string.h>using namespace std;int main(){char nameAll[5][20],…
Q: Write an expression that obtains a random integer between 34 and 55. Write an expression that…
A: To get a random number we will use rand() in c++, also we are going seed time as a parameter to…
Q: Write a program that asks user to enter a number until user enters -1. Then the program should…
A: Since you have not mentioned programming language I'm doing this in c++.
Q: Write a program that prompts the user to enter three integers and displays them in increasing order.
A: PROGRAM CODE: print("Enter three integers:…
Q: In a program, write the program's algorithm that calculates the sum of odd integers (T1) from 1 to…
A: n=int(input()) t1=0 t2=0 t3=0 for i in range(1,n+1,2): t1+=i for i in range(2,n+1,2): t2+=i…
Q: Need help with the code for this question: Write a program that prompts the user to input an…
A: Programming language is missing in the question. So we will answer this program in C++ languages. If…
Q: The date June 10, 1960, is special because when we write it in the following format, the month times…
A: As the language is not mentioned, So I have done this program in python.
Q: Write a program that prompts the user to input three numbers. The program should then output the…
A: As no programming language is mentioned, it is solved using basic C++
Q: Write a program that asks the user to type 10 integers. The program must compute how many even and…
A: Program Explanation: Declare the header files Define the main function Declare an array to store 10…
Q: how do you Write a program that prompts the user to input two POSITIVE numbers — a dividend…
A: PROGRAM STRUCTURE: Include all the required header files. Include iostream for using input output…
Q: Write a program that asks the user for a number in the range of 1 through 7. The program should…
A: def main(): # Get the number for the day of the week. day = int(input('Enter a number (1-7)…
Q: Write a program that prompts the user to enter a letter grade A/a, B/b, C/c, D/d, or F/f and…
A: PYTHON Program:- grade=input('Enter a letter grade:') # Take input grade # Check all grades with…
Q: Write a program that asks the user for three numbers and print the numbers in either ascending or…
A: n1 = float(input("Enter number a: "))n2 = float(input("Enter number b: "))n3 = float(input("Enter…
Q: Write a program that asks for the user’s name and then the program will output the last 4 characters…
A: Note : Since the programming language is not mentioned , I have used C++ language Algorithm : 1 :…
Q: write a program that prompts the user to enter 10 names. each with a minimum of 30 characters.…
A: Program: //include the essential header files #include<iostream> using namespace std;…
Q: Write the program that will ask the user to enter a positive integer, then determine and show the…
A: Program is in C language to show number of digit in that integer :- #include <stdio.h>int…
Q: A prime number is called a Mersenne prime if it can be writtenin the form 2 p - 1 for some positive…
A: Since the programming language is not mentioned, assuming the programming language to be C language.
Q: Write a program that will ask the user to enter salary amount. And then compute for the TAX amount.…
A: As the language is not specified answer written in c++ 1)Read input 2)Using if else check…
Q: Write a program that asks the user to enter the number of students, then enter the grades of these…
A: I have provided C++ CODE along with CODE SCREENSHOT and 2 OUTPUT SCREENSHOTS------------
Q: Write a program that generates a random integer N between 0 and 20 (included). Then it will ask the…
A: Algorithm: Start Generate a random number in the range 0-20 and store it in n Initialize count to 0…
Q: Write a program that displays all possible combinations for picking two numbers from integers 1 to…
A: Her is the Java program: public class Combinations{ public static void main(String[] args) { int…
Q: Write a program that asks user to enter a number. Then the program should print the sum of all…
A: Given: Write a program that asks user to enter a number. Then the program should print the sum of…
Q: 1. Write a program that prints your full name. Write a program that prints your full name using…
A: 1.) #include <iostream> using namespace std; int main(){string name;cout<<"Write your…
Q: Write a program that prompts the user to enter two integers.
A: Since the programming language is not mentioned in the question, we will answer this question in C++…
Q: Write a code that asks the user to enter several numbers that are a multiple of 5. If the user…
A: I give the code in Python because no language is mentioned along with output and code screenshot
Q: Write a program that will ask the user to enter 10 numbers and display the largest number entered.…
A: Note - As per our guidelines, we can provide solution only for one question. Since you have asked…
Q: Write a program that asks the user for a number in the range of 1 through 7. The program should…
A: In c language: #include <stdio.h> int main() { int n; printf("enter any number between 1…
Q: Write a program that asks the user to enter a distance in kilometers, and then converts that…
A: Program approach:- Using the necessary header file. Define the main function. Display 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: Write a program that prompts the user to enter a letter and displays its correspond- ing number.
A: The code for converting any mobile keypad characters into their respective numbers is written below.…
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: Write a program that prompts the user to enter 10 names, each with maximum of 30 characters. Output…
A: The program defines an array called name of type string which have size 10. A for loop is used to…
Q: Write a program that will convert miles to kilometers and kilometers to miles. The user will…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
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: Write a program that prompt the user to enter the number of students and each student's score, and…
A: #include <iostream>using namespace std; struct student{ char name[50]; float marks;}…
Q: The goal of this program is to input one number consisting of five digits (in one word) from the…
A: Start Input number If number is not 0 Print remainder when divided by 10 Divide number by 10 and…
Q: Write a program that asks the user to enter two numbers, obtains the two numbers from the user and…
A: Given: Write a program that asks the user to enter two numbers, obtains the two numbers from the…
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: Write a program that asks the user to enter "air", "water", or "steel", and the distance that a…
A: Introduction of Program: In this Java program, the speed of sound in Air=1100 feet per second, speed…
Write a
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- The date June 10, 1960, is special because when we write it in the following format, the month times the day equals the year: 6/10/60 Write a program that ask the user to enter a month in numeric format, a day and a two-digit year. The program should then determine whether the month times the day is equal to the year. If so, it should display a message saying the date is Magic. Otherwise, it should display a message saying the date is not Magic. Output should look as shown below. Create test data and place in a file. Name the code file Last Name + First Initial + "-MagicDates.s", for example "SmithJ- MagicDates.s". Name the test data file in a similar manner. Upload the program and test data files to the Dropbox. 6/10/60 is Magic! 6/10/70 is not Magic. 2/11/22 is Magic!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.XYZ Company, LLC uses a program to manage the information of their employees. The program gets the name of the employee, number of hours worked and rate per hour. It computes the salary by multiplying the number of hours worked with rate per hour. If the salary is more than 1000, tax is computed as 5% of the salary, otherwise, tax is computed as 2% of the salary. The program will display the name of the employee, salary and tax.
- Collatz Sequence: In 1937, Lothar Collatz proposed that no matter what number you begin with, the sequence eventually reaches 1. This is widely believed to be true but has never been formally proved. Write a program that inputs a number from the user, and then displays the Collatz Sequence starting from that number. Stop when you reach 1. If n is even, divide it by 2 to get n / 2. If n is odd, multiply it by 3 and add 1 to get 3n + 1. Repeat the process indefinitely. Find out and print the maximum number that you can get in these calculations. ' Part-3: Please enter a number: 2051 6154 3077 9232 4616 2308 1154 577 1732 866 433 1300 650 325 976 488 244 122 61 184 92 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1 The maximum number you get: 9232Computer 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…Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, the 405 services the 5, and the 290 services the 90. Your program will prompt the user to type a highway number ("Please enter a highway number, Ex: 65: "), read in the number typed by the user, and print out whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also your program must indicate if the (primary) highway runs north/south or east/west, that it is an invalid number if not between 0 and 999. Ex: If the input is: 90 the output is: The 90 is primary, going east/west. Ex: If the input is: 290 the output is: The 290 is auxiliary, serving the 90, going east/west. Ex: If the input is: 0 the output is: 0 is not a valid interstate highway number. #include <iostream>using…
- The following table shows the approximate speed of sound in air, water, and steel: Write a program that asks the user to enter “air”, “water”, or “steel” and the distance that a sound wave will travel in the medium. The program should then display the amount of time it will take. You can calculate the amount of time it takes sound to travel in air with the following formula: Time = Distance / 1,100 You can calculate the amount of time it takes sound to travel in water with the following formula: Time = Distance / 4,900 You can calculate the amount of time it takes sound to travel in steel with the following formula: Time = Distance / 16,400Write an application that displays the factorial for every integer value from 1 to 10. A factorial of a number is the product of that number multiplied by each positive integer lower than it. For example, 4 factorial is 4 * 3 * 2 * 1, or 24. The output would then be The factorial of 4 is 24.The date June 10, 1960, is special because when we write it in the following format, the month times the day equals the year. 6/10/60 Write a program that asks the user to enter a month (in numeric form), a day, and a two- digit year. The program should then determine whether the month times the day is equal to the year. If so, it should display a message saying the date is magic. Otherwise, it should display a message saying the date is not magic. Input Validation: Think about what legal values the program should accept for month and day.
- Fibonacci sequence: The first two numbers of the fibonacci sequence are 1 and 1, and sequential numbers are the sum of the previous two. Write a program that prompts the user for an integer n and then prints the first n numbers of the Fibonacci sequence (Please type answer no write by hend)Exercise II Write a program that finds the positive integer solutions of the following equation ax³ + bx² + cx' + d = 0. The user enters the values of coefficients a, b, c and d. The program should test each integer starting from -50 to 50, and each time the equation is equal to zero, it prints its value as well as "is a solution". At the end, it displays the total number of positive integers found. Note that if the equation has more than one solution, the plural word “solutions" is used in the output. Sample run 1: Enter the coefficient of a, b, c, d: 1 -8.5 21 -13.5 1 is a solution 3 is a solution The equation has 2 integers as solutions Sample run 2: Enter the coefficient of a, b, c, d: 6 48 103.5 67.5 The equation has no integer solutions Sample run 3: Enter the coefficient of a, b, c, d: 1 -1 -12 0 4 is a solution The equation has 1 integer solutionUsing 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…