18. Write a program that allows the user to input two integers, one for the length of the rectangle and one for the width. The program then prints the value for the area of the rectangle. Desired output: Enter a number for the length: 5 Enter a number for the width: 4 The area of the rectangle is: 20
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: 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 takes a range from the user and display all the even numbers between the range…
A: Note - Since there is nothing mentioned about the programming language to be used, so this program…
Q: 1. Write program to generate random numbers in different ranges and display the number: (a) a number…
A: Java program to find random value in different range
Q: Write a program that reads maximum 100 integers entered by user ranging from 1 to 9 and displays the…
A: Here is the python program for above implementation. See below step.
Q: 3. Write a program that plays a guessing game with the user. The program should generate a random…
A: According to the information given:- We have to follow the instruction in order to create guess game…
Q: 3. Write a program that prompts the user for a number and computes the nth term of the following…
A: logic used:- use a infinite loop to repeat till user press y or Y. inside loop, read n. set…
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: 1. Write a program that does the following: Ask the user to enter the price of their items. The user…
A: Actually, program is a executable software that runs on a computer.
Q: Write a program that prompts the user to enter three integers and display the integers in…
A: Given:
Q: 1. Write a program that reads an integer from the user. Then your program should display a message…
A: “Since you have asked multiple questions, we will solve the first question for you. If you want any…
Q: Write a program that prompts the user to input the number of quarters, dimes, and nickels. The…
A: Program: //include the header file #include <iostream> using namespace std; //definition…
Q: 1. Create a program that asks for a distance in kilometers and converts it into its metric…
A: /*C program to ask distance in kilometers and converts it into its meter equivalent*/ #include…
Q: Write a program that converts "kilometers per hour" to "miles per hour". miles = (kilometers…
A: Hi. As there is no language mentioned, I will attempt this question using Python. Let's move on…
Q: Write a program to check whether the given number is even or odd.
A: NOTE : As the question is not specific about the programming language to be used to write the code ,…
Q: 1. Write a program that converts miles to feet. If the distance is more than 15,000 feet, tell the…
A: logic:- read values in miles. Multiply miles value by 5280 and store in feet variable. If feet…
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: Procedure 2. Write a program that takes the x-y coordinates of a point in the Cartesian plane and…
A: Concept: If X is +ve and Y is +ve, then Quadrant is 1 If X is +ve and Y is -ve, then Quadrant is 4…
Q: 9. Write a program which asks the user for their score on the exam. Display their letter grade based…
A: Ans: Code: grad = input('Grad> ') if grad >= 90 fprintf('A'); elseif grad >= 80…
Q: 9) Write a program that takes in the user's name and age. Then displays his/her name's initial…
A: #include<iostream> using namespace std; int main() // main function { string name,…
Q: 6. Write a program that reads four integers from the user and outputs the largest and second-…
A: code : - // import Scanner class to get the user input import java.util.*; public class Main{…
Q: 2. Write a program that will ask for a 5-digit number and display the input number with asterisk in…
A: using System;//definition of main classclass main { //definition of the main function static…
Q: Write a program that accepts numbers from the user and counts the positive and negative numbers. The…
A: Below is the required code in C++ language. Program Approach: Including header files and using a…
Q: Write a program that converts pounds into kilograms. The program prompts the user to enter a number…
A: C++ Program: #include<iostream>using namespace std; // Function convertPtoK() to convert…
Q: 4.Write a program that displays a Pascal triangle. The program prompts the user to enter the number…
A: The answer is in below steps:
Q: 3. Create a program that will input a number in kilowatt and display its equivalent measure in…
A: As per our company guidelines we are not supposed to answer more than one question per post and…
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 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: The powers of 2 are: 1, 2, 4, 8, 16, 32, .. . Write a program to display the first power of 2, which…
A: Here i am using C++ program.
Q: what will the following code segment print on the screen? int a,x=23; a=x+2;…
A: The variable "a" is declared as "int" type. The variable "x" is initialized to the integer value…
Q: 1. Write a program that converts miles to feet. If the distance is more than 15,000 feet, tell the…
A: C program to solve the given problem is below.
Q: Write a program to read a sequence of integers (n), then print the number of the positive and…
A: Required: Write a program to read a sequence of integers (n), then print the number of the positive…
Q: Write a program that converts pounds into kilograms. The program prompts the user to enter a value…
A: Lets see the solution.
Q: 6. Write a program to read a number representing the time in 24-hours (i.e., 4-digits ). Then find…
A: import java.text.SimpleDateFormat;import java.util.*;import org.apache.commons.lang3.time; class…
Q: 3. Write a program that will input non-negative integer and would display the prime factors of the…
A: Here is the approach to achieve this :- Get the input from the user and call the prime factor…
Q: Q5: Write a program that inputs three integers from the keyboard and prints the sum, average,…
A: EXPLANATION - Create a program . Take three numbers as an input frome user named as num1 , num2,…
Q: 4. Sum of Everything by Jemar Jude Maranga Write a program that will repeatedly ask the user to…
A: Program is in step 2. In the program, as you said input should be in series and output is the sum of…
Q: Procedure 2. Write a program that takes the x-y coordinates of a point in the Cartesian plane and…
A: #include <stdio.h>void quadrant_of_x_y(float x, float y){ if (x > 0 and y > 0)…
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: Write a program that prompts the user to input an integer between 0 to 35. It the number is less…
A: Please find the answer below :
Q: Write a program that asks the user to enter an integer and then display the hexadecimal…
A: The program that asks the user to enter an integer and then display the hexadecimal representation…
Q: Write a program to convert an integer to binary number. Ask the user to enter an integer and convert…
A: Write a C++ program to convert an integer to a binary number Answer: Given a decimal number as…
Q: 6) Write a program that prompts the user to input a number. The program should then output the…
A: According to the asked question, the solution is given below with a proper explanation.
Q: Q3: Write a program that reads from the keyboard a distance in meters and the time taken as three…
A: import java.util.Scanner; public class DistanceProgram{ public static void main(String ar[]){…
Q: E2.7 Write a program that prompts the user for a radius and then prints • The area and circumference…
A: We are going to take radius as input from the user and then we will find out area of the circle,…
Q: 5- Write a program that asks the user to enter an angle in degrees and prints out the sine of that…
A: Coded using C++.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- Write a program that performs the following: 1) request a full name input by the user 2) display the first name 3) display the last name 4) display the initial in the format shown in the example output Input text can be any content. Just make sure to precisely match the output format below. Write your entire program in the ANSWER area provided below (must include comments if using code is not covered in the course). Example Output Enter your full name (first and last): Tom CatFirst Name: TomLast Name: CatInitial: T.C.2.15 LAB: Musical note frequencies On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance (number of keys) from that key, and r is 2(1/12). Given an initial key frequency, output that frequency and the next 4 higher key frequencies. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print(f'{your_value1:.2f} {your_value2:.2f} {your_value3:.2f} {your_value4:.2f} {your_value5:.2f}')Java Program ASAP ************This program must work in hypergrade and pass all the test cases.********** The text files are located in Hypergrade. Also for test case 1 first display Please enter a string to convert to Morse code:\n then you press Enter it should print out \n. Then for test case 2 it should display Please enter a string to convert to Morse code:\n then you type abc it should print out .- -... -.-. \n For test case 3 first display Please enter a string to convert to Morse code:\n then you type This is a sample string 1234.ENTER it should print put - .... .. ... .. ... .- ... .- -- .--. .-.. . ... - .-. .. -. --. .---- ..--- ...-- ....- .-.-.- \n. This program down below does not pass the test cases as shown in the screenshot I have provided the correct test case as a screenshot too. Please modify it or create a new program so it paases the test cases. Thank you! For test case 1 it wants only Please enter a string to convert to Morse…
- Write a program that displays a table of pounds and equivalent weights in kilograms. You can find the conversion factor online if necessary. Store this factor in a properly named constant. Allow the user to specify the range of pounds for the table by prompting for the start, stop, and step values for the pounds column. Display the pounds accurate to two decimal places centered in a column 10 characters wide. The kilometers should display accurate to three decimal places and right-aligned in a column 12 characters wide (see page 75-78). Column headings should be displayed with the same alignments. See Sample Output.Write a program that queries information from three files(given to you). The first file contains the names and telephone numbers of a group of people. The second file contains the names and Social Security numbers of a group of people. The third file contains the names and annual income of a group of people. The groups of people should overlap. Your program should ask the user for a telephone number and then print the name, Social Security number, and annual income, if it can determine that information. Sample run1: Enter the phone number (7 digits, with a dash): 555-1234 555-1234 is associated with Bob Bob's SSN is 000300021 Bob's salary is 55000 Sample run2: Enter the phone number (7 digits, with a dash): 675-4566 Couldn't find a name associated with that number. Sample run3: Enter the phone number (7 digits, with a dash): 000-2345 000-2345 is associated with John John's SSN is 000000004 John's salary is 65000 python languageIn Chapter 4, you created a program that generates a random number, allows a user to guess it, and displays a message indicating whether the guess is too low, too high, or correct. Now, create a modified program called GuessingGame2 in which the user can continue to enter values until the correct guess is made. After the user guesses correctly, display the number of guesses made. Recall that you can generate a random number whose value is at least min and less than max using the following statements: Random ranNumber = new Random(); int randomNumber; randomNumber = ranNumber.Next(min, max);
- a. Write a program named CheckMonth that prompts a user to enter a birth month. If the value entered is greater than 12 or less than 1, display an error message; otherwise, display the valid month with a message such as 3 is a valid month. b. Write a program named CheckM0nth2 that prompts a user to enter a birth month and day. Display an error message if the month is invalid (not I through 12) or the day is invalid for the month (for example, not between 1 and 31 for January or between I and 29 for February). If the month and day are valid, display them with a message.Given the following code segment, what is output to the screen? char name1[20] = "Sean"; char name2[20] = "Pierce"; strcpy(name1,name2); cout << name1 << " " << name2; Group of answer choices Pierce Pierce Sean Sean Sean Pierce None of these ================== Given the following code segment, what is output to the screen? void assignments(int&, int); int main() { int output = 0, input = 5; assignments(output, input); cout << output << endl; } void assignments(int& myOutput, int myInput) { if (myInput < 0) myOutput = -2; else if (myInput == 0) myOutput = 0; else myOutput = myInput; } Group of answer choices 5 0 -2 None of these ============== A void function can be used in an assignment. Group of answer choices True FalseYou have been asked to develop the new system. You are to write an application to assign seats in an airline. Assume a small airplane with 28 seats (7 rows 4 wide) as follows: 1 A B C D 2 A B C D 3 A B C D 4 A B C D 5 A B C D 6 A B C D 7 A B CD The program should display the seat pattern, with an X marking the seats already assigned. 1 X B C D 2 A X C D 3 A B C D 4 A B X D 5 A B C D 6 A B C D 7 A B C D The program then requests a choice of seat. If the seat if available,then the seating display is updated. Otherwise, the program requests another choice of seat. If the user types in a seat that is already assigned, the program should say that that seat is occupied and ask for another choice. This continues until all seats are filled or until the user says that the program should end.
- (1) Prompt the user to enter two words and a number, storing each into separate variables. Then, output those three values on a single line separated by a space. Ex: If the input is: yellow, Daisy, 6 Output: You entered: yellow Daisy 6 (2) Output two passwords using a combination of the user input. Format the passwords as shown below. Ex: If the input is: yellow, Daisy, 6 Output: You entered: yellow Daisy 6 First password: yellow_Daisy Second password: 6yellow6 (3) Output the length of each password (the number of characters in the strings). Ex: If the input is: yellow, Daisy, 6 Output: You entered: yellow Daisy 6 First password: yellow_Daisy Second password: 6yellow6 Number of characters in yellow_Daisy: 12 Number of characters in 6yellow6: 8Many documents use a specific format for a person's name. Write a program that reads a person's name in the following format: firstName middleName lastName (in one line) and outputs the person's name in the following format: lastName, firstInitial.middleInitial. Ex: If the input is: Pat Silly Doe the output is: Doe, P.S. If the input has the following format: firstName lastName (in one line) the output is: lastName, firstInitial. Ex: If the input is: Julia Clark the output is: Clark, J.NEED HELP PLEASE! Write a Java program to read a text file (command line input for file name), process the text file and perform the following. Print the total number of words in the file. Print the total number of different words (case sensitive, meaning “We” and “we” are two different words) in the file. Print all words in ascending order (based on the ASCII code) without duplication. Write a pattern match method to find the location(s) of a specific word (a character string up to twelve characters, e.g. system). This method should return all line number(s) and location(s) of the word(s) found in the file. Print all line(s) with line number(s) of the file where the word is funds by invoking the method of 4). Under each output line indicate the location(s) of the first character of the matched word (refer to the output example below). Empty lines are lines, they also have their own unique line numbers. Repeat the pattern match (4 and 5 above) until user types in EINPUT. A word is…