1. Write a program that asks the user to enter three names, and then displays the names sorted alphabetically in descending order. For example, if the user entered “Charlie", "Leslie", and "Andy", the program would display: Leslie Charlie Andy Note that these three names are just an example. The names could be any words.
Q: compare loans with various interest rates) Write a programthat lets the user enter the loan amount…
A: By given problem, it is to be desired to display the user different loan amounts according to the…
Q: (Print distinct numbers) Write a program that reads in ten numbers and displays the number of…
A: The required Java code is: import java.util.Scanner;public class Distinct{ public static void…
Q: 7. Write a program that keeps reading values from the user until the user enters a negative value,…
A: The Answer is in given below steps The code is in c language
Q: In this exercise, you will create a program that reads words from the user until the user enters a…
A: Procedure followed: Declare variables str: to store words and size: to maintain the count of words.…
Q: Complete the program below which counts the number of capital letters in word? count = 0 for char in…
A: In this python program, we need to find the number of capital letters by completing the program. The…
Q: Write a program that reads your id and full name and display. And also display the index of first…
A: To do: write program according to given
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: Some sample runs of the program are included below (user input is in bold): > java ThreeWords Enter…
A: As per our guidelines, we are supposed to answer only one question. Kindly repost the remaining…
Q: Q7: Write a program that reads a collection of car speeds as long as the speeds do not exceed 100…
A: Program Approach: Including necessary header files Using namespace for standard input output…
Q: Problem Description: Write a program that displays all the numbers from 100 to 1,000 -ten per line-…
A: Program: import java.util.*; import java.lang.*; public class Main { public static void…
Q: a nonpalindromic prime number whose reversal is also a prime. For example, 17 is a prime, and 71 is…
A: We will define two function isPrime() to check a number is prime or not and another function called…
Q: need help urgent
A: The program starts by asking the user to enter a number n. sqrt() function in "math.h" library is…
Q: Question 1 Write a program that finds the new salary of an employee after several years of work…
A: Note: Programming language not mentioned in the question. C++ is chosen for implementation.…
Q: Exercise 1: Ask the user to type a string. Count and display the number of vowels (a,e,i,o,u). Print…
A: Note: Since no programming language is mentioned. I am attempting this in python. if you need it in…
Q: Complete the program below which counts the number of capital letters in word? count = 0 for char in…
A: Python
Q: 5. A positive whole number n > 2 is prime if no number between 2 and n (inclusive) evenly divides n.…
A: Introduction : Here we have to write a program that accepts a value of n as input and determines if…
Q: #include int pqr(int, int); int main() { int x=pqr(20,2); printf("%d",x); return 0; int pqr(int…
A: Well Lets understand the function pqr int pqr(int x ,int y){ if(x==0) return 0; else…
Q: Homework01. Write a Java program that prompts the user to enter the seconds as a String (e.g.,…
A: - The question is to complete the conversion.
Q: Program which accepts the user's first and last name and print them in reverse order with a space…
A: The Answer is
Q: Sometimes a company will use telephone numbers like 757-GET-FOOD to make the numbers easier to…
A: A = B = C = 2D = E = F = 3G = H = I = 4 J = K = L = 5 M = N = O = 6 P = Q = R = S = 7 T = U = V = 8…
Q: Question 2 Write a program which prints the following message in the output screen. *List of Items*…
A: #print first lineprint(" "+"*"*11+"List of Items"+"*"*11)#print second lineprint("Item\t\tprice…
Q: int function(int num1, int num2) { if (num2 == 0) return 1; if (num2 % 2 == 0) return function(num1…
A: the question tells us to trace the execution of the program. the program basically is recursive…
Q: Write a program that reads two excel sheets. One of these sheets contains a list of items names. The…
A: CODE: # Import library to read excel fileimport openpyxl # Reading the sheets in the…
Q: Consider records of employees each consists of employee's first name (string), number of hours…
A: I give the code in python along with output and code screenshot
Q: In python. Write a program that orders three integers x, y, z in ascending order. But you can NOT…
A: The numbers placed in ascending order is known as sorting the numbers or placing the numbers with…
Q: Complete the program below which counts the number of capital letters in word? count =0 for char in…
A: EXPLANATION: The upper() function is in general used for the purpose of converting all the…
Q: 5. Write a program that generates random numbers as below, random number between 0 and 10 Numl Num2…
A: In the below program srand(time(0)); has been used to make sure that each number generated is…
Q: i. Void search(int * m[],int x) { } void search(int * m, int x) ii. {
A: Given code is 1) Void search (int * m[],int x) { } 2) void search (int*m,int x) { }
Q: Voltage readings are obtained from an electrical substation once every hour for six hours Write a…
A: The Program language is not mentioned here. So, I am using C language to answer your question. The C…
Q: Question 5: Write a program that inputs four strings that represent floating-point values, converts…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED C FOR THE SOLUTION Define header…
Q: Write a program that prompts the user to enter a set of integer numbers, and finally displays the…
A: Program Approach : Include necessary libraries. Define array , index variables . Ask the user to…
Q: أسئلة على لغة اسمبلي 1-Write a program to read a letter in lower case then convert this letter to…
A: 1) .MODEL SMALL.STACK 100H.DATA CR EQU 0DHLF EQU 0AH MSG1 DB 'ENTER A LOWER CASE LETTER $'MSG2 DB…
Q: A string with any message. Then, determine if the message contains the string, "hello" using array.…
A: Solution - Programming language used - C# All necessary comments are included in program code.…
Q: Write a program that displays a given integer with the corresponding comma in place. Before, commas…
A: Answer: I have done code and also I have attached code and code screenshot as well as output
Q: Write a program to use enumeration type to represent the seven colors of the rainbow, i.e. red,…
A: switch (choice) { case 1: cout << "Red color is chosen. The next color is…
Q: A number in base 2 (binary) is a number such that each of its digits is 0 or 1. To convert from…
A: Since the programming language is not mentioned, we are providing the answer in Java language.
Q: Q5/ 1. 1. Write a program to read three marks and calculate the average. If the student's average is…
A: Since no programming language is mentioned, I am using python. As per our guidelines, we are…
Q: Write a program that reads 10 numbers and then finds the largest number and prints it and finds the…
A: Programming language is not defined so I am providing program in python. Pseudo code Declare a…
Q: Write a program that reads input until encountering either the # character or the % character and…
A: - We need to highlight the code to read the characters until # or % is seen and return the count of…
Q: Write a program that calculates the amount of money a person would earn over a period of time I f…
A: According to the information given:- We have to follow the instruction in order to get the desired…
Q: A number in base 2 (binary) is a number such that each of its digits is 0 or 1. To convert from…
A: code '; def main(): binary = input("Enter a 5 digit binary number: ") #input the binary…
Q: Write code using 999999999888888887777777666666555554444333221 Note; create means you must create…
A: Objective: This program should receive user input for the number of lines to display a pattern. The…
Q: a. Write a program that reads your id and full name and display. And also display the index of first…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Read id and name…
Q: Create a c++ langauge that ask the user to enter a name (one word only) and then print the name in…
A: Code: #include <iostream>#include <bits/stdc++.h>using namespace std; int main(){…
Q: Q/Write a program that reads from the user a set of numbers, and first, it has to check how many…
A: Note: Since no programming language is mentioned. I am attempting this in python. if you need it in…
Q: Sandwich Maker Write a program that asks users for their sandwich preferences. The program should…
A: The advantage of Python allowing elements of a list to be of various types is that we can store all…
Q: Write a program that prompts the user to enter twostrings and displays the largest common prefix of…
A: Since the programming language is not mentioned in the question, we will answer this question in the…
Q: Refer to the code segment in Program (A), Identify the value of temp. Program (A) int a[6] =…
A: Below is the complete C++ program to implement the given block of code also the code is well…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- 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.The Café Noir Coffee Shop wants some market research on its customers. When a customer places an order, a clerk asks for the customer’s zip code and age. The clerk enters that data as well as the number of items the customer orders. The program operates continuously until the clerk enters a 0 for zip code at the end of the day. When the clerk enters an invalid zip code (more than 5 digits) or an invalid age (defined as less than 10 or more than 110), the program reprompts the clerk continuously. When the clerk enters fewer than 1 or more than 12 items, the program reprompts the clerk two more times. If the clerk enters a high value on the third attempt, the program accepts the high value, but if the clerk enters a negative value onthe third attempt, an error message is displayed and the order is not counted. At the end of the program, display a count of the number of items ordered by customers from the same zip code as the coffee shop (54984), and a count from other zip codes. Also…Part 1: Complete the survey. Part 2: Peek-a-boo is a fun game that little kids like to play. To simulate this game on the computer, write a program that will generate a random number between 1 and 4. Then, will print to the screen the animal name associated to that number. The animal names used will be: pig when a 1 is generated cow when a 2 is generated chicken when a 3 is generated horse when a 4 is generated If your program generates a 3, the output will be: chicken The player will then enter a 1 if they would like to play again or anything else to exit the program. If the player enters "1 1 1 0", the output will be: horse chicken cow horse For coding simplicity, follow each output animal by a space, even the last one. Hint: To make testing easier, seed your random number generator with 0.
- This example creates a program to teach a first grade child how to learn subtractions. The program randomly generates two single- digit integers number1 and number2 with number1 > number2 and displays a question such as "What is 9 – 2?" to the student. After the student types the answer, the program displays a message to indicate whether the answer is correct.Question 2: Write a program to check responses of a student to the multiple-choice final exam. The final exam consists of 20 questions, and answer sheet is abedeabcdeabedeabcde. Your screen should look like: Please, write your answers: abbdeabbdeabbdeabbde Please, write your answers: or aaaaaaaaaaaaaaaaaaaa Your score is 16 out of 20. Your score is 4 out of 20.4. A software company sells game cartridges for $99. Quantity discounts are given according to the following: 10 - 19 20% discount 20 49 O 30% discount 50 – 99 O 40% discount 100 + O 50% discount Write a program that asks the user how many games they purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount is applied. Don't forget to add HST. 5. Earlier we wrote a BMI calculator. Enhance the program so that it displays a message indicating whether the person has optimal weight (BMI between 18.5 and 24.9), is underweight (BMI is less than 18.5), is overweight (BMI between 25 and 29.9), or is obese (BMI 30 or higher).
- The Fibonacci series is a series that begins with 0 and 1 and has the property that each succeeding term is the sum of the two preceding terms. For example, the third Fibonacci number is 1 which is sum of 0 and 1. The next is 2, which is a sum of 1 + 1. Write a program that displays the first ten numbers in a Fibonacci series.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…Write a program that asks the user for two positive integers between 2 and 10 to use for the length and width of a rectangle. If the numbers are different, the larger of the two numbers should be used for the length and the smaller for the width. The program should then display a rectangle of this size on the screen using the character ‘X’. For example, if the user enters either 2 5 or 5 2, the program should display the following:
- 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.TASK " Write a program that grades students' exam. The exam has 20 multiple choice questions. Here are the correct answers: 1- A 6- B 11-C 16- D 2- A 7- B 12- C 17- D 3- А 8- В 13-С 18- D 4- А 9- В 14- С 19- D 5- A 10-B 15- C 20- D "A student must correctly answer 15 of the 20 questions to pass the exam. " Write a class named StudentExam that holds the correct answers to the exam in an array. TASK (CONT.) " The class should also have an array that holds the student's answers. The class also should have the following methods: I passed. Returns true if the student passed the exam, or false if the student failed " totalCorrect. Returns the total number of correctly answered questions I totallncorrect. Returns the total number of incorrectly answered questions " questionsMissed. An int array containing the question numbers of the questions that the student missed. 1 On another class, ask the student to enter his name, take his answers and display the results returned from the StudentExam…Write a program that generates a random number in the range from 1 through 100 After generating the random number, the user is to guess the number. If the user’s guess is higher than the random number, the program should display “Too high, try again” If user’s guess is lower than the random number, the program should display “Too low, try again”. If the user guesses the number, the program should congratulate the user and then generate a NEW random number so the game can start over. Make the game menu driven with these options Main Menu ______________ 1)Play Game 2)Exit written in python