1. Program the following. Ask User to select one option from the following. Calculate area of Circle [c] Calculate area of Rectangle [r] • Calculate area of Triangle [t] O If user enters c then ask user to enter radius and calculate area using following formula. A = ar O If user entersr then ask user to enter length & width and calculate area using following formula. A = wl O If user enterst then ask user to enter base & height and area using following formula. h, b A Display the area.
Q: Assume variable middle_initial has a one-letter string in it.If we also assume this letter is in…
A: given data Assume variable middle _initial has a one-letter string in it. If we also assume this…
Q: (Use Dev++) Write a program that finds the day of the week for any given date using Zeller’s…
A: C++ is one of the most popular programming language developed by Stroustrup at Bell Labs. The basic…
Q: Note: i) e3 can be written as ii) a) Assume 0 is t b) Use (t*3.1 Which of the following is the…
A: We need to write sine theta, given to assume theta as t and Theta is calculated as t*3.14/180 so it…
Q: 1 + 2L + 3.0F Select the correct data type that the above expression evaluates to in C# O int long O…
A: Hi there, Please find your solution below, I hope you would find my solution useful and helpful.…
Q: Question # 1: Write a program that inputs age in years and displays age in days and months
A: Answer 1: Purpose: The program should determine the equivalent months and days for a user's age…
Q: QUESTION 14 To assign a value 1 to variable x, you write O 1 = x; O x = 1, O x = 1, O1 = x; O x ==…
A:
Q: Programming Practice a) Write a program which allows a teacher to determine the min, max, and…
A: Disclaimer: “Since you have asked multiple questions, we will solve the first question for you. If…
Q: Write a program to calculate the GPA in First semester. 1- The program asks the marks out of 100 in…
A: Explanation: Arrays of marks, weight and GPA are created. Input is taken in the marks array, and…
Q: Assume you have three int variables: x = 2, y = 6, and z. Choose the value of z in the following…
A: x=2, y=6 The given is a ternary operator. (Condition)? Case1 : case2 If condition is evaluated to…
Q: After execution of the following code, what is stored in valueNum?
A:
Q: Write program: prompt user to enter 2 double numbers which are the radius of 2 circles. Save values…
A:
Q: Suppose that x, y, and z are int variables and x = 13, y = 45, and z = 20. Determine whether the…
A: a. !(x - y <= 10) Decoding the above line is as follows, ==> !(13-45<=10) ==> !(-32…
Q: Write a program to generate a random number between 1 - 100, and then display which quartile the…
A: Program Instructions:Use the header files, constants, seed and random number generator given in the…
Q: Write an app that reads in a 5 digit number and determines if it is a palindrome. A palindrome is a…
A: The code is given below. using System; public class HelloWorld { public static void…
Q: What is the output of the following code when x is .equal 5 * x = CInt(Text1.Text) If x = 1 Then…
A: output of the code:-
Q: Write a program that computes for the values of X, Y and Z, depending upon the choice entered from…
A: Hello Student, hope you are doing well, I will be trying my best to explain and fulfill your query.…
Q: Question 1 Write a python program that takes an option from the user and based on the option read wo…
A: Answer: Here is the code: #…
Q: program so that the user enters the rate of tuition increase for the first year. the rate then…
A: C++ used to answer this question
Q: QJ Write a program to calculate the amount of three equations according to the amount of z. Where,…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.…
Q: In Visual Studio, use assembly language to solve the following problem Based on the following…
A: I have answer this question in step 2.
Q: - Create a program using IF condition based on the following: • Allow the user to input the…
A: Given:
Q: Write a program will then ask for the prelim grade, midterm grade and final grade of the student.…
A: The question is to write C++ code for the given problem.
Q: 1.Create simple number guessing game as follows. First, prompt the user to enter a min and max…
A: Given: please use java to answer the following question
Q: a) The program randomly generates two "integers between 0 and 9 inclusive" (int1 and int2) and…
A: Programming language is not mentioned in the question. So we will answer the program in C++…
Q: 3. Write a program that computes and interprets the Body Mass Index (BMI). The program prompts the…
A: Take two inputs from user for height and weight convert height in meter(h*0.0254) and weight in…
Q: Using c++ Madison County collects property taxes on the assessed value of property, which is 60…
A: #include<iostream>#include<iomanip>using namespace std;int main(){double propertyValue,…
Q: Activity #1 Create a program that calculate the volume of a sphere. Then display the result. Use the…
A: NOTE: - Hi, as per the guideline, the first activity is answered below. PROGRAM EXPLANATION: - The…
Q: Shannon and Jasmine bowl as a team. Each of them bowls three games in a tournament. They would like…
A: For this program we need 6 inputs, 3 of shannon and 3 of jasmine. And then we need to do some…
Q: Write a program that will perform one of the following operations: 1. Print the Fibonacci series…
A: I give the code in C++ along with output and code screenshot
Q: Write a program that prompts for an odd integer that is between 50 and 100, inclusive. Use just one…
A: #Program to validate user input of odd and in range number #prompt user to enter an odd number…
Q: 1. Write a program which calculates the monthly Budget of a person. The program will read the…
A: Sample Response: //Java menu-deriven program that cacluates the different monthly bills according to…
Q: Let A = {4, {4, 5}, {5},Ø}. ANswer each of the following questions. 1) |A| = 5 2) Which of the…
A: Here in this question we have given a set A and based on this we have asked to answer true or false…
Q: Q#4: Program the following. · Prompt user to input distance in Kilometers and display it in meters.…
A: Note: Since you have asked multiple questions we will solve only few questions for you and if you…
Q: Write a VB program to ask user to assign a value to “i” to find the answer for the following three…
A: Dim i As IntegerDim HowMuch As IntegerHowMuch = 0For i = 1 To 10 If i < 5 Then HowMuch…
Q: Write a program that will calculate the account balance after we deposited the amount of money for a…
A: NOTE: Since programming language is not mentioned. Therefore answering in MATLAB. First input…
Q: Q5. Write a program that ask to input value in seconds. Then the program converts the number of…
A: seconds = eval(input("Enter the number of seconds:"))print("The time in hours, minutes, and…
Q: Using C++, write a program for a "6/15 Lottery Game". Please take note of the following: 1. It must…
A: I have followed all the instructions, have followed all the scenarios and played the game. let's see…
Q: While exercising, you can use a heart-rate monitor to see that your heart rate stays within a safe…
A: Algorithm: 1. take user input of age 2. find max hear rate by using given formula 3. find range by…
Q: be assigned to the Double variable w when the following statement is executed? w = (x + y)/(x - y) 1…
A: Answer Option d: 2
Q: Write a program to calculates the cost to a company for a proposed raise. The program prompts for…
A:
Q: 1# Write a program that allows users to choose from one of three shapes: Squares, Circles or (right)…
A: As programming language is not mentioned so we are solving this in C++
Q: Have the user enter number of exam scores you would like to find the average and standard deviation.…
A: According to the information given:- We have to follow the instruction to get the desired output for…
Q: Write a code snippet that can arrange the alphabets of a name entered by user in alternate cases.…
A: The required C program code is: #include <stdio.h>void changeCase(char []); // function…
Q: Supply the codes so that numbers will display starting with s and ending with e. Assume that the…
A: code snippet:
Q: 3. Write a program that computes and interprets the Body Mass Index (BMI). The program prompts the…
A: Prompt to enter the weight in pounds. Store the value in a variable. Prompt to enter the height in…
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) Prompt the user to enter two positive integers n and m (you are not required to handle the case…
A: #include<iostream>#include<math.h>#include<stdlib.h>#include<conio.h>using…
Q: Q1 \\ Ali Evaluate the value stored in the variable "result" in the following expressions using…
A: Q1(a) result = a * b + c - d % e result = 5 * 20 + 10 - 4 % 7 ( * have higher priority ) result =…
Q: Write one program that will compute both the Least Common Multiple, and the Greatest Common Factor…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Language C
Step by step
Solved in 3 steps with 4 images
- 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }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.Assume that a box of apples cost 8 dollars and a box of grapes cost 6 dollars. Given variables numBoxApples and numBoxGrapes that are read from input, compute the total cost and assign combinedCost with the result. Ex: If the input is 7 10, then the output is: Cost: 116 include <iostream> using namespace std; int main() { int applePrice = 8; int grapePrice = 6; int numBoxApples; int numBoxGrapes; int combinedCost; cin >> numBoxApples; cin >> numBoxGrapes; /* Your code goes here */ cout << "Cost: " << combinedCost << endl; return 0; }
- Given an airplane's acceleration and take-off speed v, you can compute the minimum runway length needed for an airplane to take off using the following formula. length=v^2/2*a. write a program that prompts the user to enter V in meters and acceleration an in meter/second and display the minimum runway length.Write a program to generate a random number between 1 - 100, and then display which quartile the number falls in. First quartile is 1 - 25 Second quartile is 26 - 50 Third quartile is 51 - 75 Fourth quartile is 76 - 100 To generate a random number, follow these steps: include necessary header files #include <cstdlib> //for random functions #include <ctime> //for time functions set constants for the minimum and maximum values of the desired range const int MIN_VALUE = 1; //minimum range value const int MAX_VALUE = 100; //maximum range value seed the random number generator (RNG) with a unique unsigned int value - system time! unsigned seed = time(0); //system time in seconds since 1/1/1970 srand(seed); //seed the RNG get a random number in the desired range int num = (rand() % (MAX_VALUE - MIN_VALUE + 1)) + MIN_VALUE; The program should: contain header comments as shown in class display a "hello" message (more descriptive than shown in sample) generate…Write a program that will perform one of the following operations:1. Print the Fibonacci series from 0 to N2. Print the Prime numbers from 0 to N3. Print the Factorial of the numbers from 0 to NInclude at least the following functions in your program:• menu: a function to display the operations listed aboveo Use a switch-statement to process the user’s choice• fibonacci: a function that will print the Fibonacci series from 0 to N o Sample Input: Suppose N = 5o Sample Output: 0 1 1 2 3 5 • primeNumbers: a function that will print the prime numbers from 0 to N o Sample Input: Suppose N = 5o Sample Output: 2 3 5 • factorial: a function that will print the factorials of the numbers from 0 to N o Sample Input: Suppose N = 5o Sample Output: 0! 1! 2! 3! 4! 5! = 1 1 2 6 24 120 Include a loop that will allow the user to repeat the whole program if he wants to. PLEASE add "//" every code wirtten to explain its use in the program. thank you! do the following conditions set and DO IT IN C++
- The great circle distance is the distance betweentwo points on the surface of a sphere. Let (x1, y1) and (x2, y2) be the geographicallatitude and longitude of two points. The great circle distance between the twopoints can be computed using the following formula:d = radius X arccos(sin (x1) X sin(x2) + cos(x1) X cos(x2) X cos(y1 - y2))Write a program that prompts the user to enter the latitude and longitude of twopoints on the earth in degrees and displays its great circle distance. The averageradius of the earth is 6,371.01 km. Note you need to convert the degrees into radiansusing the Math.toRadians method since the Java trigonometric methods useradians. The latitude and longitude degrees in the formula are for north and west.Use negative to indicate south and east degrees. Here is a sample run: Enter point 1 (latitude and longitude) in degrees: 39.55 −116.25 ↵EnterEnter point 2 (latitude and longitude) in degrees: 41.5 87.37 ↵EnterThe distance between the two points is…Exercise 3.9Modify program P34_1.cpp to compute the side area, total area, and volume of a cylinder and thearea and volume of a sphere, depending on the choice that the user makes. Your program shouldask users to enter 1 to choose cylinder or 2 for sphere, and display an "invalid choice error" forother values.For a cylinder, we want to compute:Side area: (2*PI*r) * hTotal Area: 2*(PI*r2) + Side areaVolume: (PI*r2)*hFor a sphere, we want to compute:Surface area: 4*PI*r2Volume: (4.0/3.0)*PI*r3.Use overloading whenever possible.Call your new program Ex39.cpp.(1) Prompt the user to enter a string of their choosing. Store the text in a string. Output the string. Ex: Enter a sample text: We'll continue our quest in space. There will be more shuttle flights and more shuttle crews and, yes, more volunteers, more civilians, more teachers in space. Nothing ends here; our hopes and our journeys continue! You entered: We'll continue our quest in space. There will be more shuttle flights and more shuttle crews and, yes, more volunteers, more civilians, more teachers in space. Nothing ends here; our hopes and our journeys continue! (2) Implement the PrintMenu() function to print the following command menu. Ex: MENU c - Number of non-whitespace characters w - Number of words f - Find text r - Replace all !'s s - Shorten spaces q - Quit (3) Implement the ExecuteMenu() function that takes 2 parameters: a character representing the user's choice and the user provided sample text. ExecuteMenu() performs the menu options, according to the…
- (1) Prompt the user to enter a string of their choosing. Store the text in a string. Output the string. Ex: Enter a sample text: We'll continue our quest in space. There will be more shuttle flights and more shuttle crews and, yes, more volunteers, more civilians, more teachers in space. Nothing ends here; our hopes and our journeys continue! You entered: We'll continue our quest in space. There will be more shuttle flights and more shuttle crews and, yes, more volunteers, more civilians, more teachers in space. Nothing ends here; our hopes and our journeys continue! (2) Implement a PrintMenu() function, which has a string as a parameter, outputs a menu of user options for analyzing/editing the string, and returns the user's entered menu option. Each option is represented by a single character. If an invalid character is entered, continue to prompt for a valid choice. Hint: Implement Quit before implementing other options. Call PrintMenu() in the main() function. Continue to call…Fox International sells pre-paid calling card with the following features: Calls to USo 1.2 cents per minute plus a 49 cent connection fee per call Calls to Europeo 2.3 cents per minute plus a 49 cent connection fee per call Calls to Australiao 6.4 cents per minutes plus a 49 cent connection fee per callWrite a program that work out the charges for the month. The program should accept the followinginformation: Account holders name Card number Starting Balance on card For US callso Total number of minutes of all callso Total number of calls made For European callso Total number of minutes of all callso Total number of calls made For Australian callso Total number of minutes of all callso Total number of calls madeYou are NOT expected to error check your inputs for this assignment. (e.g. checking for negative values,etc.). There is NO GST charged on the calls as the GST was paid when the card was purchased.Format of output:Review the test plan to see how the user would like the…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…