Drag and drop the appropriate statement to get the output shown below code segment Output message = "Hello World!" stars = *** Hello World! **** space = print(stars, message, stars) print(stars + space + message + space + stars) print(space, stars, message, star, space) print(message)
Q: The body mass index is calculated as a person’s weight (in pounds) times 720, divided by the square…
A: BMI calculator program in pyhton where weight and height are taken input and BMI is calculated using…
Q: z=0 i=2 n=int(input("Enter any number")) while i<=n: z=z+i / i+2 print (z) i=i+1 for the above…
A: Given python code, z=0 i=2 n=int(input("Enter any number")) while i<=n: z=z+i/i+2 print(z)…
Q: Celsius to Fahrenheit: Write a program that converts Celsius temperatures to Fahrenheit…
A: Step 1:- Program Approach:- (i)Include two header file (ii) iomanip header file is used for fixed()…
Q: Factorial) The factorial of a nonnegative integer n is written n! (pronounced “n factorial”) and is…
A: C++ code: #include <iostream>using namespace std; int factorial( int n){ int i = 1, final = 1;…
Q: Write two cin statements to get input values into birthMonth and birthYear. Then write a statement…
A: Here I have included the header file iostream used for input and output. Next, I have used namespace…
Q: if-else Statements Consider the following if-else statements. Determine the output of the given…
A: Given snippet: int a = 2, b = 9; if (b % a == 0) cout << b << "is even"; else cout…
Q: Write two scnr.nextInt statements to get input values into birthMonth and birthYear. Then write a…
A: The corrected code is given below:
Q: Randomly generate a number. If this number is in range [1, 12], map it to a month name and display,…
A: I have provided JAVA CODE along with CODE SCREENSHOT and 2 OUTPUT…
Q: Q9: - Use (If-Then - Else) statement to write a visual basic program to read x and compute the…
A: The following is the syntax of if-then-else in Visual basic: If cond_1 Then // Statements if above…
Q: 5. The user will input a Philippine amount, then the said amount will be converted to different…
A: Get Phillipine peso input from user. Calculate currency amount's equivalence using the formula (1…
Q: by using c++ solve following questions. 1. Write a program that inputs salary and grade, It adds…
A: Here, you need to take input from user for salary and grade. So to store input values, you need to…
Q: a. In case the value entered by the user has less or more than 4 digits the program must outpu have…
A: Java program: import java.util.Scanner; //Creat Classpublic class Main { //main method public…
Q: 1- Write a program to enter average and find the grade rating() (Excellence, Very good, Good,…
A: NOTE NO PROGRAMMING LANUAGE IS MENTIONED SO I WAS USED C++ LANGUAGE 1) #include…
Q: Summary During winter when it is very cold, typically, everyone would like to know the windchill…
A: Program code: //include required header files #include <iostream> #include <cmath>…
Q: Write a code snippet that can arrange the alphabets of a name entered by user in alternate cases.…
A: To convert any character to lowercase /uppercase syntax is Character.toLowerCase(ch) /…
Q: Problem Solving 1 – Shipping Charges The currier express company charge the following rates within…
A: I give the code in C++ along with output and code screenshot
Q: Write two scnr.nextInt statements to get input values into birthMonth and birthYear. Then write a…
A: for input use scanner class
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: Write a single statement to print: user_word,user_number. Note that there is no space between the…
A: Given,A variable named user_word to store a word entered by the user.A variable named user_number to…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both…
A:
Q: Software Sales A software company sells a package that retails for $99. Quantity discounts are given…
A: Algorithm: 1. Input unit sold 2. Check if quantity is not negative. 3. Check the condition for…
Q: A country charges income tax as follows based on one’s gross salary. No tax is charged on the first…
A: 1) Since you have not specified programming language, I have written program in python 1) Below is…
Q: Write the algorithm and a program that prompts the user to input the masses of the bodies and the…
A: 1. Input the masses of the two bodies and the distance between them. 2. Calculate the force between…
Q: Declare double variables num1, den1, num2, and den2, and read each variable from input in that…
A: Double type variables:- A variable of type double is a 64-bit floating data type.The double data…
Q: Suppose Dave drops a watermelon off a high bridge and lets it fall until it hits the water. If we…
A: Given, d=0.5×g×t2 g=9.8 meters/second2 Program description: t is the user input integer variable…
Q: Armstrong numbers between two intervals Write a program to print all the Armstrong numbers in the…
A: Find Your Code Below
Q: Q1) Write a program that takes as input any change expressed in Saudi Riyals. It should then compute…
A: //Note: Always the language of code in which you want the result. //For Now I am doing this in java…
Q: 3.7 LAB: Output range with increment of 10 Write a program whose input is two integers, and…
A: The complete answer in Java programming language is given below:
Q: 5. The user will input a Philippine amount, then the said amount will be converted to different…
A: We need to write a C language program that reads input from the user for currency in Philippine peso…
Q: Philippine currency composes of 1000, 500, 200, 100, 50, 20 bills and 10, 5, 1 coins. Write a…
A: Code: As you have not mentioned the coding language i am providing the code in C: #include…
Q: z=0 i=2 x=int(input("Enter any number") while i<=n: z=z+i/i+2 print(z) i=i+1 for the above program,…
A: Code: z=0i=2x= int(input("enter any number"))#reading user input#while loopwhile i<=x:…
Q: A country charges income tax as follows based on one’s gross salary. No tax is charged on the first…
A: Check further steps for the answer :
Q: Question 1: Write a C program that do the following: Ask the user to enter his grade as (A, B, C, D,…
A: Include an appropriate header in the C program such as stdio.h. stdio.h is a C header file that…
Q: Write two cin statements to get input values into birthMonth and birthYear. Then write a statement…
A: Explanation:A C++ program should include header file “<iostream>”, begins with “#” sign.This…
Q: 3- Which sentence will show on display screen for the following program: program myprog…
A: Hello student. Greetings Hope you are doing great. I will try my best to answer your questions.…
Q: Q1: Write a program to ask the user to input a number then Check Whether the input Number is Even or…
A: #include <stdio.h>int main() { int n; printf("Enter an number to check: ");…
Q: Finish the following c++ code by following the instructions Your program is to work as follows:…
A: A C++ program for the given criteria is as follows, #include<iostream> using namespace std;…
Q: Suppose that height is a double variable, ch is a char variable, and name is a string variable. What…
A:
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: A software company sells a package that retails for $99. Quantity discounts are given according to…
A: question :- Program using C++ language without the use of logical operators (&&, || ,!) To…
Q: The output of the statement print ‘hello’,’goodbye’ is __________. a. hello b. hello goodbye c.…
A: According to the Question below the solution:
Q: One metric ton is approximately 2,205 pounds. Write a program that prompts the user to input the…
A: The below given C++ program will obey the following rubrics: Including necessary header files. In…
Q: Write two scnr.nextInt statements to get input values into birthMonth and birthYear. Then write a…
A: Given: Write two scnr.nextInt statements to get input values into birthMonth and birthYear. Then…
Q: Write a program to input a number x from the keyboard. If the number is larger than 0, find its…
A: #include<stdio.h> #include<math.h> int main()…
Q: An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular…
A: Actually, the code has given below:
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: Q2) Write a program to calculate the average of the semester. To find the average of the semester,…
A: import java.util.*;public class Main{ public static void main(String[] args) { int a=0,b=0,c,d;…
Q: a runner runs 14 kılometers in 45 minutes and 30 sec- onds. Write a program that displays the…
A: => Here in the program ask for a calculating average speed in miles per hour.
Q: Write two scnr.nextInt statements to get input values into birthMonth and birthYear. Then write a…
A: According to the Question below the Solution: Output:
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- import java.util.Scanner; /** * ii. - This program allows money to be input in one currency and then its converted to a second * currency. The user must input the amount of money and 2 currency codes which should be USD (for dollar), * GBP (pound) and EUR (Euro). If either of the currency codes are incorrect, the program should display an error message * and end. If the user types in two currency codes that are the same, they should be trapped in a loop until the codes are different. * The money should be converted to the other currancy and the value of the monies in both currencies should be displayed. public class ChangeCurrency { public static void main(String[] args) { Scanner scan = new Scanner(System.in); double money = 0, convertedMoney = 0; String firstCurrency = "", secondCurrency = ""; //The following are the exchance rates so euroToDollar = 1.14 means 1 euro is equal to 1.14 dollars final double euroToDollar =…Output below. You have to code1. 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.
- An acronym is a word formed by taking the first letters of the words in a phrase and making a word from them. For example, RAM is an acronym for "random access memory." Write a program that allows the user to type in a phrase and then outputs the acronym for that phrase. Note: The acronym should be all uppercase, even if the words in the phrase are not capitalized.import java.util.Scanner; /** * Question 2 - This program allows money to be input in one currency and then its converted to a second * currency. The user must input the amount of money and 2 currency codes which should be USD (for dollar), * GBP (pound) and EUR (Euro). If either of the currency codes are incorrect, the program should display an error message * and end. If the user types in two currency codes that are the same, they should be trapped in a loop until the codes are different. * The money should be converted to the other currancy and the value of the monies in both currencies should be displayed. * * Student Number: * * Student Name: * */public class ChangeCurrency { public static void main(String[] args) { Scanner scan = new Scanner(System.in); double money = 0, convertedMoney = 0; String firstCurrency = "", secondCurrency = ""; //The following are the exchance rates so euroToDollar = 1.14 means 1 euro is equal to…Create the follow program using Raptor, pseudocode, flowcharting, or Python per your instructor, A Python program is also acceptable. Use the concepts, techniques and good programming practices that you have learned in the course. You have unlimited attempts for this part of the exam. Input a list of employee names and salaries and store them in parallel arrays. End the input with a sentinel value. The salaries should be floating point numbers Salaries should be input in even hundreds. For example, a salary of 36,510 should be input as 36.5 and a salary of 69,030 should be entered as 69.0. Find the average of all the salaries of the employees. Then find the names and salaries of any employee who's salary is within 5,000 of the average. So if the average is 30,000 and an employee earns 33,000, his/her name would be found.
- Q5: (Count positive and negative numbers and compute the average of numbers) Write a program of C++ that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number. Here is a sample run: Enter an integer, the input ends if it is 0: 1 2 -1 3 0 The number of positives is 3 The number of negatives is 1 The total is 5.0 The average is 1.2510-6. Addition: One common problem when prompting for numerical input occurs when people provide text instead of numbers. When you try to convert the input to an int, you’ll get a ValueError. Write a program that prompts for two numbers. Add them together and print the result. Catch the ValueError if either input value is not a number, and print a friendly error message. Test your program by entering two numbers and then by entering some text instead of a number.(PYTHON) (Display characters) Write a function that prints characters using the following header: def printChars(ch1, ch2, numberPerLine): This function prints the characters between ch1 and ch2 with the specified numbers per line. Write a test program that prints ten characters per line from 1 to Z.
- Use this table to convert digits to barcode representation and vice-versa; each digit is represented in 5 characters; so 1 will be represented as 00011; as 0 is represented as half bar (:) and 1 is a full bar (1) ; 1 will be represented as :::|| ; similarly 9 is 10100 and will be represented as |:|:: Write a program that asks the user for a ZIP code and prints the bar code. Use : for half bars, | for full bars. For example, 95014 becomes ||:|:::|:|:||::::::||:|::|:::||| Your program should also be able to carry out the opposite conversion: Translate bars into their ZIP code, reporting any errors in the input format or a mismatch of the digits. javaa. Write a program that takes integers as arguments and adds them.b. Write a program that takes integers as arguments and multiplies them.c. Write a program that takes integers as arguments & adds & multipliesthem using the above two programs.Programming Lang - Java & using the Scanner class Create this program below Part A: While Loop Program Write a program that detects Fibonacci numbers. Prompt the user to input a positive integer. Upon input, the program will determine if the number is either a Fibonacci number or not. If a Fibonacci number, then the order of the number in the sequence must be output. If not a Fibonacci number, then the Fibonacci numbers above and below it (including their order in the sequence) must be output. Once it finishes, the program will prompt the user for a new number. The program will exit if the user enters a non-integer number or string (such as “quit”) instead of an integer. Use the sample output file, fib-seq-det.txt, to view a sample session. Additionally: For both the above problems, the first four numbers of the Fibonacci sequence are 0, 1, 1, and 2. Part A must use While loops only. Sample Output: Welcome to the Fibonacci Sequence Detector Please input a number for…