Write Algorithm for a program that asks the user to enter two numbers. Then ask the user to enter 1 to add these numbers or 2 to multiply these numbers
Q: )Write program to print all the numbers divisible by 4 and 5 up to a number of N(entered by user at…
A: n = int(input("Enter number:"))for i in range(0, n+1): if((i%4==0) & (i%5==0)): print(i)…
Q: Pretend that you have just opened a new savings account that earns 4 percent interest per year. The…
A: Answer:)
Q: O Looking At College Apartments | It's Gett.. G Grok | Calculate rok Code Gym 1a academy Calculator…
A: I've used the input() function in this example. To collect data from the user. To subtract the…
Q: Output Formatting with Numbers and Columns and Loops Write a program that converts the temperatures…
A: Program plan: Declare the celsius value as 1 Define a for loop that iterates from 1 to 20 to…
Q: (Find the number of years) Write a program that prompts the user to enter the minutes (e.g., 1…
A: start input minutes calculate number of years and days print it stop
Q: Write a program to find all even numbers between 100 and 400. The number obtained should be printed…
A: There is no programming language mentioned so we are using c++ as default. This can be solved using…
Q: Python Programming The Fibonacci sequence starts 1, 1, 2, 3, 5, 8, . ... Each number in the…
A: Fibonacci Numbers : The Fibonacci numbers are the numbers in the following integer sequence : 0 , 1…
Q: User Prompts Your program will allow a human user to play Rock, Paper, Scissors with the computer.…
A: #Program import random def main(): print('ROCK'+'PAPER'+''+'SCISSORS'+''+'in Python') print()…
Q: Write a program that inputs year and month number, it then display the number of days in that month…
A: The given problem is to be solved in programming language where the user will input the year and…
Q: WRITE A PROGRAM TO CALCULATE THE AGE OF THE USER AFTER THE USER ENTERS HIS OR HER YEAR OF BIRTH
A: #Python code to calculate Age #Importing required modulefrom datetime import date #Taking user input…
Q: A integer n is divisible by 9 if the sum of its digits is divisible by 9. Develop a program to…
A: As no programming language is mentioned, it is solved using basic C++
Q: (Find the number of days in a month) Write a program that prompts the user to enter the month and…
A: Code:- print("1 for January") print("2 for February") print("3 for March") print("4 for April")…
Q: Write c program that will take two numbers a and b from user and find and display small number from…
A: Given: To write code in C.
Q: 1. Reverse a number (integer) by iterative program. Reverse a number: Input: prompt user to enter an…
A: Note : Since there are multiple questions, according to the guidelines I have done the first…
Q: Write a program that input numbers from the user until user press “E”. Program should display total…
A: Positive number is identified if the entered number is greater than zero. Negative number is…
Q: ariable x as you write this program. x will represent a positive integer. Write a program that…
A: Required: Use the variable x as you write this program. x will represent a positive integer. Write a…
Q: Find the number of years and days) Write a program that prompts the user to enter the minutes…
A: Lets see the solution in the next steps
Q: rite an algorithm and flowcharts for the following: a) Sum the even numbers for n numbers b) Display…
A: For a: Define variable n and take user input for the limit in it. Define variable i and initialize…
Q: Find the numbers that can be expressed as the product of two nonnegative integers in succession and…
A: Note :- You have not mention the language of program ,So i am doing your question in C++ language.…
Q: 1. Write a program that lets the user guess whether a randomly generated integer would be even or…
A: Algorithm / steps : Generate the random number Ask the user guess for even or odd Incase…
Q: Enter an integer : 9 Enter an integer : 10 Enter an integer : 3 Enter an integer : 7 Sum is 22
A: Step 1: Initialize sum to 0. Step 2: Iterate loop 4 times to repeat steps 3, 4 and 5. Step 3: Read…
Q: Homework: Write a program that prompt the user to enter a number. Then determine if the number is…
A: Below is the code in python as language not specified and sample output:
Q: Exercise 2: Write a java program that asks user to enter a set of positive integer values. When the…
A: code: //importing required packageimport java.util.Scanner;//main classpublic class Main{ //main…
Q: Write a program called NumberGuess to play the number guessing game. The program shall generate a…
A: Note: Since you have not mentioned the programming language, I have attempted this in python. if you…
Q: Girl Scout Troop 815 has 18 members. Write the pseudocode for a program in which the troop can enter…
A: The following the required pseudo code for display the total number of boxes sold and calculate…
Q: Create an algorithm for a basic calculator that will perform the sum, difference, product, and…
A: An algorithm is a finite set of instructions that if is followed accomplishes a particular task. In…
Q: Write pseudo code that will calculate a running sum. A user will enter numbers that will be added to…
A: # initialize sum = 0 summ = 0 # an infinite loop while True: # taking input num =…
Q: Instructions Write a program that calculates and prints the number of minutes in a year. Assume the…
A: Given: Write a program that calculates and prints the number of minutes in a year. The program is…
Q: /** * Given two integers, the second larger than the first, this program: * 1) prints the even…
A: The below given Java program will obey the following rubrics: Importing required data package.…
Q: (Apartment problem) A real estate office handles , say, 50 apartment units. When the rent is, say,…
A: PROGRAM: //Header file #include <iostream> #include<iomanip> //Using namespace using…
Q: * Given two integers, the second larger than the first, this program: 1) prints the even numbers…
A: Program description: Java program,ForLoops.java that prompts users to enter two integer values and…
Q: write pseudocode for a program that calculates the sum of all numbers that the user enters. The user…
A: Declare a variable number and a variable to store sum Prompt user to enter a number while…
Q: Test Average Write a program that asks for five test scores. The program should calculate the…
A: #include<iostream>#include<iomanip>using namespace std;int main(){ double total=0;…
Q: *4.1 (Count positive and negative numbers and compute the average of numbers) Write a program that…
A: Integer:- In Java, int is a primitive data type while Integer is a Wrapper class. int, being a…
Q: 4) The price of stocks is sometimes given to the nearest eighth of a dollar; for example, 29 7/8 or…
A: #include<iostream> using namespace std; double stockCost(int x, int y, int z, int stock); void…
Q: (Calculating the Sum of Even Integers) Write a program that calculates and prints the sumof the even…
A: Introduction: (Calculating the Sum of Even Integers) Write a program that calculates and prints the…
Q: Count positive and negative numbers and compute the average of numbers) Write a program that reads…
A: Code import java.util.Scanner; public class NumbersStats { public static void main(String[]…
Q: Q3a) Summary Newton’s law states that the force, F, between two bodies of masses M1 and M2 is given…
A: Note: since programming language is not mentioned we are providing solution in c++. Part a)…
Q: Write Psuedo-code of an algorithm that will repeatedly ask the user to enter a number 10 times. If…
A: Psuedo code is step by step written outline that can be easily translated into the program.
Q: (Find the two highest scores) Write a program that prompts the user to enter the number of students…
A: You have not mentioned any specific language so I did the code in Python and also provide the code…
Q: Write a Little Computer Man program that determines if the number entered by a user is an odd or…
A: Process: A number is even if it is perfectly divisible by 2. When the number is divided by 2, we use…
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: (Game: learn addition) Write a program that generates two integers under 100 and prompts the user to…
A: Write a program using python language which will find a sum of two random numbers under 100 and then…
Q: Warm-up: Integer Operations Write a program that asks the user to enter two integers and prints the…
A:
Q: (Find future dates) Write a program that prompts the user to enter an integer for today’s day of…
A: Actually, integers are like whole numbers, also included negative numbers.. but not allows floating…
Q: Write a program that can be used as a math tutor for a young student. The program should display two…
A: Introduction: Write a programthat can be used as a math tutor for a young student. The program…
Q: Write a program that asks the user for their name and how many times to print it. The program should…
A: Use a loop to iterate the for specified number of times and print the name in each iteration
Q: write pseudocode for below: Determine and display whether a number entered is even or odd.
A: Explanation: By using if-else loop we check whether number is odd or even. If number % 2==0 then…
Write
Step by step
Solved in 2 steps
- (General math) The value of p can be approximated by this series: 4(113+1517+....) Using this formula, write a program that calculates and displays the value of , using 2, 3, and 4 terms of the series.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.Challenge 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.
- 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.Financial application: compute future apartment rent) Suppose that the rent for an apartment is $1000 thisyear and increases 3% every year. Write a program that computes the rent in five years and the total rent forone year starting five years from now.Volume and Area of a Regular Icosahedron An icosahedron is a regular polyhedron with 20 congruent equilateral triangular faces. Ask the user to supply the length of one of the edges (one side of a triangular face) and then calculate the total surface area and volume of the icosahedron. Report the answers and then repeat. Your program should loop until the value 0 is entered for the radius – and then it should promptly exit. Only positive numbers are allowed for the length of the edge. ???? =? √?∗?? ??????=?/?? (?+ √?)∗ ?3
- Volume and Area of a Regular Icosahedron An icosahedron is a regular polyhedron with 20 congruent equilateral triangular faces. Ask the user to supply the length of one of the edges (one side of a triangular face) and then calculate the total surface area and volume of the icosahedron. Report the answers and then repeat. Your program should loop until the value 0 is entered for the radius – and then it should promptly exit. Only positive numbers are allowed for the length of the edge. ???? =? √?∗?? ??????=?/?? (?+ √?)∗ ?3 assemblyTask 2: Multiples Write a program that asks the user for an integer n, and then prints first 10 multiples of that integer. Use a while/do...while loop. Example: Enter an integer: 2 Output: 2 x 1 = 2 2 x 2 = 4 2 х 3 %3D 6 2 x 4 = 8 2 x 5 = 10 12 2 х6 2 x 7 2 х8 14 16 2 x 9 18 2 x 10 = 20Exercise 2: Count the Numbers Write a program that prompts the user to enter a number n. Then, it asks the user to enter a sequence of numbers ending with -999. The program then displays the count of numbers in the sequence smaller than n, the count of numbers larger than n, and the count of numbers equal to n. Sample input/output: Enter the value of n: 56 Enter a number, -999 to stop: 67 Enter a number, Enter a number, Enter a nu er, Enter a number, Enter a number, Enter a number, Enter a number, -999 to stop: 23 -999 to stop: 19 -999 to stop: 88. -999 to stop: 56 -999 to stop: 12 -999 to stop: 85 -999 to stop: 55 Enter a number, -999 to stop: -999 There are 4 numbers less than 56 There are 3 numbers There are 1 numbers grater than 56 equal to 56
- 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 9835PROGRAM 6: Three Zero Game Write a program that reads a number. Then by subtracting off a three and tens, determine if that value ends in a zero or a three. Three such numbers in a row wins the game! Shown below are sample program dialogues to help you build your program. Gimme a number: 20 It ends in zero! Keep going... Gimme a number: 53 It ends in three! Keep going... Gimme a number: 41 Sorry Charlie! You lose the game! Gimme a number: 50 It ends in zero! Keep going... Gimme a number: 23 It ends in three! Keep going... Gimme a number: 70 It ends in zero! You Win The Game! Gimme a number: 51 Sorry Charlie! You lose The Game! (Hint: This program is pretty complex with many different conditions to keep track of. I would recommend you write it first in C or Visual Basic and then translate your lines of code, one-by-one, into a assembly statements, just like our good friend mr. compiler does) (Hint: Since we don't really know how to do much math in Assembly yet, I am assuming you will…Excercise 30 defines the number e and exerecise 31 shows how to approximate the value of e using a different expression. Interestingly the value of e can also be approximated using the foloowing expression: 2+1/1+1/2+2/3+3/4+4/5+5.../(n-1)+(n-1)/n+n Write a program that uses this formula to approximate the value of e. Test your program for n = 3, 5, 10, 50, and 100.