5. Write a program that reads 3 items, item1, item2, item3, from the keyboard a. if 1 and 2 are the same add 3 to the total of 1 and 2 b. if 1 and 2 are not the same subtract 3 from the total of 1 and 2 c. if the result of a and b are the same, and the difference is greater than item1, add a to b and multiply 6 d. if the result of a and b are the same, and the difference is
Q: Write a program in python Suppose a right triangle is placed in a plane as shown below. The…
A: Let the coordinates of three corners be (x1, y1), (x2, y2) and (x3, y3). And coordinates of the…
Q: Write a program that does the following: 1. prompts the user to enter a word 2. using that word,…
A: To Do: To write the C++ Code.
Q: 8. Write a program that takes the lengths of the three sides of a triangle from the user and checks…
A: Need to write a program to check whether provided length of three sides of the triangle will form…
Q: Write a program that reads from the user a character ('q' or 'c'). • i the character is 'c', the…
A: Since the programming language is not mentioned, we'll do it in python. The programming methodology…
Q: Write a program that reads integers between 1 and 100 and counts the occurrences of each. Assume the…
A: The question is to write the code for the given problem. As here no language has been mentioned Java…
Q: 10) Write a program that translates a letter grade into a number grade. Letter grades are A, B, C,…
A: note:- always mention programming language name in question, this is done in python. logic:-…
Q: (b) Write a program that produces a triangular grid of numbers as a seating chart (start at 1 in the…
A: C++ code for given problem Statement- #include <iostream>using namespace std;//main methodint…
Q: 4)Write program that input the user age and print the sentence: a) You are child if the age is less…
A: There is not mentioned any programming language so I used JAVA Step 1 : Declare a variable age and…
Q: Write a program that will read a number from the keyboard. If 60≤number≤100 , display “Pass”, if…
A: Conditional Statement in C: Conditional statements in C execute sequentially based on the some…
Q: Problem #3: Write a program that reads the width, height and a character from the user, then…
A: As there is no programming language is mentioned we are writing this program in c++ Code…
Q: QUESTION#5: Write a program that inputs a sequence of non-negative numbers terminated by a negative…
A: Declare an array to store the given input Append the negative number at the end of each list Compute…
Q: 4. Write a program that takes data one line at a time and reverses the words of the line. For…
A: Source Code: #include<stdio.h>#include<string.h> /* Program that reverses the words in…
Q: Write a program that reads any 5 numbers as in the given sample of output below: Sample of…
A: Required: Write a program that reads any 5 numbers as in the given sample of output below:
Q: Develop a program that 1- Would read an input from the keyboard. The input should be a whole…
A: while True: #1- Would read an input from the keyboard. The input should be a whole positive…
Q: Write a program to enter a value of x and compute the value of y where x if x ≥0 -x if x < 0 y =
A: #include <stdio.h>int main(){ int x,y; printf("Enter value of x: ");…
Q: Write a program to read the number a and print: 1 if it is 1 = a, 2 if it is a = 2, 3 if it is a = 3
A: Program code: //header file #include <iostream> using namespace std; //start of main int…
Q: 9. Write a program that inputs two real numbers then exchanges their values. 10. Make a program that…
A: 9 Solution
Q: 9. Write a program to print out all Armstrong numbers between 1 and 500. If sum of cubes of each…
A: Here let's define a function sumCube() to find sum of cube of digits.
Q: 7. Write a program that asks the user's name, and then greets the user by name. Before outputting…
A: The problem is based on writing the code to input users' name and to greet the user after converting…
Q: 9. Write a program to print out all Armstrong numbers between 1 and 500. If sum of cubes of each…
A: Since the programming language isn't mentioned, we will use the C language We will run a loop to…
Q: 1)Write program to make simple calculator? The program input two number and one character? a) print…
A: As programming language is not mentioned i am providing you the answer in C++.
Q: 5) Write a program to determine the number of thousands, hundreds, tens, and ones in a given integer…
A: #include <stdio.h> int main() { int n=8532; // declare and initialize the digit int…
Q: Write a program that does the following: 1. prompts the user to enter a word 2. using that word,…
A: Code: Output:
Q: write a program to print the name of day when entering the number of the day. (For example, when the…
A: read a value convert it into int using Integer.Parse() if x=1 then display “sunday” else if x=2 then…
Q: A palindrome is a word or a phrase that is the same when read both forward and backward. Examples…
A: Simple Algorithm: Step1: Start. Step2:Read the string from the user. Step3: Calculate length of the…
Q: Write a program which repeatedly reads several people's height numbers in cm(centimeter) until the…
A: As no programming language is mentioned, it was implemented using simple Python
Q: 4. Write a program that asks the user to enter two positive integers, the height and length of a…
A: The below given Python program will obey the following rubrics: Displaying message to the user to…
Q: Task 1 Write a Python program that will ask the user to input a string (containing exactly one…
A: # As per our guidelines we are supposed to answer only one question. Kindly repost other questions…
Q: 1. Make a program to accept two integers X and Y, then compute the difference. If X-Y is Negative,…
A: The Answer is
Q: s Write a program to read three numbers and prints the biggest one. طباعة ارقم الأكر من ثلالة ارقام…
A: Question :-
Q: Write a program that reads from the user a character ('q' or 'c'). If the character is 'c', the…
A: Note: As the programming language is not mentioned, program is written in c++ ALGORITHM Step 1:…
Q: Exercise • Write a program that asks the user -Do you want to use this program? (y/n) • If the user…
A: Code: #include <iostream> using namespace std; int main(){ string c="y"; int count=1;…
Q: Q13: Write a program to read X and print Sin X if X>0, square root X f X<0 and absolute X if X/2 is…
A:
Q: 9. Write a program that inputs two real numbers then exchanges their values. 10. Make a program that…
A:
Q: A palindrome is a word or a phrase that is the same when read both forward and backward. Examples…
A: A palindrome is a word or a phrase that is the same when reading both forward and backward. Examples…
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: 02: write a complete program in e++ Language to input a number and check if a number is less than or…
A: Program: #include <iostream> using namespace std; int main(){ int num;…
Q: Task 2 Write a Python program that will ask the user to enter a word as an input. • If the length of…
A: The ask is to write a python program doing the following: - Take a user input for a word - If the…
Q: Write a program that would compute the sum, difference, product, quotient, and will print the…
A: As no programming language is mentioned, it is solved using C++
Q: Write a program that reads from the user a character ('q' or 'c'). if the character is 'c', the…
A: Java Program for above : import java.util.Scanner; class Prog{ public static void main…
Q: C++) Write a program with total change amount as an integer input, and output the change using the…
A: /*Write a program with total change amount as an integer input that outputs the change using the…
Q: E2.8 Write a program that asks the user for the lengths of the sides of a rectangle. Then print •…
A: As you have not mentioned any specific language so I give the code in Python along with output and…
Q: 2. Write a program to read a number. If the number is a multiple of 3, then enter three new numbers…
A: Question 2 is given below
Q: Task 2 Write a Python program that will ask the user to enter a word as an input. • If the length of…
A: Algorithm: Start Read a string(word) if string length is less than 4 print the word if string ends…
Q: 3. Write a program that accepts two input numbers and compute the Greatest Common Divisor using…
A: Since you have not mentioned programing language I'm doing this in c.
Q: Task 2 Write a Python program that will ask the user to enter a word as an input. • If the length of…
A: Declare the variable str1 to get the input from the user Declare the string variables str2=er and…
Q: Write a program that reads the integers between 1 and 50 and counts the occurrences of each. Assume…
A: To write program reading integers 1 and 50 and count, print the occurrence of each.
Q: rite a program that reads a value n and displays n characters alternating between # and % on the…
A: Note: Since you have not provided the language name to write the code so I am using java language to…
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images
- Loops question. Write a C program that reads an integer k from the user and then prints the multiples of 1 up to k, the multiples of 2 up to k/2, etc. For k = 10, the printout would be 1,2,3,4,5,6,7,8,9,10, 2,4,6,8,10 3,6,9 4,8 5,10,In C++, Write a program that asks a user to input five numbers on the same line separated by spaces, then do the following:a. Print out the five numbers (with spaces or tabs between them).b. Calculate and print the sum, average, and product of the numbers.Loops, C++ Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer. Ex: If the input is: -15 10 the output is: -15 -10 -5 0 5 10 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than the first. For coding simplicity, output a space after every integer, including the last.
- C++ Write a program that accepts an integer number and determines whether the number is "EVEN" or "ODD. If it is even, compute the square of the number and display the message “Even number”. If the number is odd, compute and print the cube of the number and also display the remark "Odd number" , else display a remark "The number entered is zero."Write a program that inputs a sentence from the user and counts the number of words and characters in the sentence.In C++, write a program that inputs three integers from the keyboard and prints the sum, average, product, smallest and largest of these numbers. The screen dialog should appear as follows: Input three different integers: 13 27 14 Sum is 54 Average is 18 Product is 4914 Smallest is 13 Largest is 27
- Write a program that reads a person's first and last names separated by a space, assuming the first and last names are both single words. Then the program outputs last name, first name. End with newline. Example output if the input is: Maya Jones Jones, MayaWrite a program that deals a number of cards (their numerical values) to a player's hand. To begin, the program asks the player for the values of the deck of cards. Then, the program deals the first two cards of the deck to a player's hand, and asks him if he wants another card. If he does not want a card, the program ends. If he wants a card, the program deals the next available card in the deck, adds it to the player's hand, and asks the player if he wants another card. The dealing process repeats as long as the user continues to accept cards, or until the cards in the deck run out. Card dealing involves copying the available card from the deck vector to another vector, which stores the player's hand, at the next available position. Assume that the deck of cards consists of only 10 cards with numerical values from 1 to 10, which the player will enter by keyboard before the program deals. The following functions must be implemented/used: enterDeckValues. - This…Write a program that does the following: 1. prompts the user to enter a word 2. using that word, first prints out the word where all characters are replaced by “_”’s (there will be an example to better illustrate this below). 3. the program will continue to print the word revealing one character at a time. i.e., The second line printed should print the first character followed by “_”’s representing the rest of the word. 4. The program should end after printing the entire word once Example: Enter a word: kangaroo ________ k_______ ka______ kan_____ kang____ kanga___ kangar__ kangaro_ kangaroo Note: you will have to use nested loops in this problem.
- in phython langauge: Write a program which reads the number of blocks the builders have,and outputs the height of the pyramids that can be built using these blocks.Question 4. Write a Program to check any number is SPY number or not ?HINT: A spy number is a number where the sum of its digits equals the product of its digits. For example:1124 is a spy number, because the sum of itsdigits is 1 + 1 + 2 + 4 = 8 andthe product of its digits is 1 * 1 * 2 * 4 = 8 is equal.Difficulty Level : EasySample Input: 2114 Output: Given number is spy numberDM your codes. We .In C++, write a program that checks whether there are duplicated numbers within three user inputted numbers, and return if "all the numbers are distinct", "all numbers are the same", or if "there are two are duplicated numbers."