2. You are again working for the census bureau and they need some statistics regarding the distribution of ages. Write a program to read in a number of ages. (You do not know upfront how many entries you have, so you need to keep track of it.) Compute the average age and the age that occurs most frequently (some of the ages might be the same). Ages should be read in as integers, the average should be a real number. Calculate the population standard deviation using the formula: 2 n. ai/n-(/n) Standard deviation = 1 1
Q: Your completed program should: 1. Prompt the user and read in the number of a team playing the…
A: Your completed program should: 1. Prompt the user and read in the number of a team playing the…
Q: You can find out how many seconds have elapsed since Jan 1, 1970 using the time() function.…
A:
Q: Question 2 Write a program which takes two float numbers from the user and check, if first number is…
A: algorithm:- (I) input first, second (II) if(first>second) { first=first+5;…
Q: 4. Before you can cross a bridge with your car, it must weigh within +/- 100 pounds of 1 ton For…
A: Hey, since multiple questions posted, we will answer first question according to our policy. If you…
Q: Sometimes we write similar letters to different people. For example, you might write to your parents…
A: Note: Since no programming language is mentioned in the question, the program has been provided in…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
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: 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: . If we change the statement calc(x, y); to calc(1, 3) in the program, explain why would be an…
A: Define header file <iostream> which has the i/o operation files Define method calc with…
Q: 2. Write a program for the Air Force to label an aircraft as military or civilian. The program is to…
A: Here is the approach : Create the two integers to take input for the plane speed and the plane…
Q: When analyzing data sets, such as data for human heights or for human weights, a common step is to…
A: The answer is
Q: Suppose you have a certain amount of money in a savings account that earns compound monthly…
A: Inorder to give user the option if he wants to use the service again I have used while loop logic at…
Q: Please write sequences of cars and cdrs that will pick the symbol 'x out of the following…
A: Write sequences of cars and cdrs that will pick the symbol 'x out of the following expressions. Let…
Q: Write a python program that displays every integer between 1 and 100 that is divisible by 5 or 7,…
A: Using While loop output : Editable code : i = 1while i<100 : if i % 5 == 0: if i…
Q: The following equation estimates the average calories burned for a person when exercising, which is…
A: Algorithm: Start Read Age,Weight, HeartRate, Time Calculate Calories = ((Age x 0.2757) + (Weight x…
Q: Given 3 integers, output their average and their product, using integer arithmetic. Ex: If the input…
A: ACTUALLY FLOATING POINT ARITHEMATIC TAKES CEIL VALUE:
Q: Question 2 Write a program which takes two float numbers from the user and check, if first number is…
A:
Q: Write a program c++ that prints the letter A instead of the number 65, without using variables or…
A: Sample Response: //C++ program to print A without using any variables#include<iostream>using…
Q: iii) Read input a positive integer from the user and print "Yes, all digits are equal." if all the…
A: Write a program in PHP language to read input a positive integer from the user and print “Yes, all…
Q: Q1/an A-Write a program to compute the drag force F, (in Newton) When a body swims through fluid,…
A: Logic:- Given values of p=1000 vinf=1.25 A=0.25 Cd=0.09 We have to calculate Fd, Given formula:-…
Q: A university recently conducted a survey with regards to demographics and programmes in which…
A: Please refer below code for explaination as comments are given below: // Online C compiler to run C…
Q: EAD QUESTION CAREFULLY AND STRICTLY USE PROVIDE TERMS IN QUESTION AS IT IS. MATCH INPUT AND OUTPUT.…
A: Required: READ QUESTION CAREFULLY AND STRICTLY USE PROVIDE TERMS IN QUESTION AS IT IS. MATCH INPUT…
Q: Using C++, write a program that will check the employees years in service and office. The user will…
A: Given: Using C++, write a program that will check the employees years in service and office. The…
Q: Your relative, who goes to primary school and has just learned the multiplication table, asks you to…
A: using System; public class Multiplication { public static void main() { int i,n,count=0;…
Q: Solve the problem with C++ (Count positive and negative numbers and compute the average of numbers)…
A: I give the code in C++ along with output and code screenshot
Q: can you guys help me write the c++ program for this question? thanks
A: We have taken age from a file age.txt (containing different number representing ages of different…
Q: Q1/A-Write a program to compute the mass flow rate of a fluid (in kg/sec) through a thermal unit…
A: Code: Dim A as DoubleDim M as DoubleDim Po as Double Dim K as DoubleDim R as DoubleDim T0 as…
Q: Suppose you have a certain amount of money in a savings account that earns compound monthly…
A: Here I have created a function that takes 3 input parameters, compute the future value and return…
Q: b) A sequence of numbers is given by the equation; Xn+2 = Xn+1 + xn Χη, ie if X1 and x2 = 1 then x3=…
A: Since 1st 2 terms are not mentioned, I am using c++. Code: x=zeros(1,12); x(1)=1; x(2)=1;…
Q: Can someone help me answer this in Coral programming language? 1) The year must be divisible by 4…
A: Answer :
Q: The force of gravity is different for each planet of the nine planets in our solar system. For…
A: Program Code: #include<iostream>using namespace std;main(){ float weight,n_weight; char ch;…
Q: You are working for a lumber company, and your employer would like a program that calculates the…
A: Objective: This program would compute the total cost of woods of different types where the costs for…
Q: Federal law requires that hourly employees be paid “time-and-a-half” for work in excess of 40 hours…
A: workingHours=float(input("Enter number of working hours: ")); #input working…
Q: Write a program which input radius of circle and compute area of it. Then input the length of side…
A: EXPLANATION - Create a program . Declare three variable radius , length , area1 , area2 . Take…
Q: Write a program that reads the marks of a student in the test (te), midterm (mid), assignment…
A: I am uploading the handwritten solution in the next step. As there is no programming language…
Q: 3. Question 1 Write a program which takes two float number from the user and check, if first number…
A: Since you are not specify any language for implementation, I choose C language. Program #include…
Q: Q1/an A-Write a program to compute the drag force F, (in Newton) When a body swims through fluid,…
A: Hello student Greetings Hope you are doing great Thank You!!!
Q: 1. Write a program that computes the area of each color in an archery target. For simplicity, we…
A: Note: Since no programming language is mentioned. I am attempting this in python. if you need it in…
Q: Q1: Write a program that input four grades for six students and output a. The grades summation for…
A: #include<iostream.h>#include<conio.h> #include<dos.h> void main ( ) {…
Q: Q4:// Write a program to calculate the volume of one Mole of an ideal gas as a function of pressure…
A: Here have to determine program for calculate volume of mole gas.
Q: The following equation estimates the average calories burned for a person when exercising, which is…
A: Accept below value from user: Enter age in year. Enter weight in pounds. Enter heart eate in beats…
Q: The population of one of Arabia in 1980 was about 12 million, if he learned that an increasing rate…
A: Write the c++ program that will print the three things using the following data, Initial year 1980…
Q: 1. Write a program that computes the area of each color in an archery target. For simplicity, we…
A: ANSWER:-
Q: 12. Write an improved version of the futval.py program from Chapter 2. Your program will prompt the…
A: CODE:- 1. Call the main() function. 2. Display the result in the tabular format. 3. Print the…
Q: Task 13 Write a Python program that takes a number and tells how many digits are in that number.…
A: Program description: n is the user input integer variable that stores the value of the number. count…
Q: 4. Write a program to calculate the bottom surface perimeter, surface area and volume of a cylinder.…
A: You have not specified any language to write the code so, I have used C language to create the…
Q: 2. Construct a program where you deciare and initialize a constant variable, now try to reassign…
A: EXPLANATION: The constant variables are basically those variables which can not be modified at the…
Q: 3) Write a program to find a. Surface area (A= 2 r n) b. volume(v=r ² a h) of a cylinder using…
A: Algorithm: Step-1: Start Step-2: Take input radius and height from the user. Step-3: Calling…
Q: Write a program to determine whether a year entered through the keyboard is a leap year or not. Also…
A: Program approach:- Using the necessary header file. Add your own birth year and other stuff below.…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- Write an improved version of the futval . py program from Chapter 2.Your program will prompt the user for the amount of the investment, theannualized interest rate, and the number of years of the investment. Theprogram will then output a nicely formatted table that tracks the value ofthe investment year by year. Your output might look something like this: Year Value----------------0 $2000 . 001 $2200 . 002 $2420 . 003 $2662 . 004 $2928 . 205 $3221 . 026 $3542 . 127 $3897 . 43You are conducting a linguistic study and are interested in finding words that contain the letter 't' or 'T' in the first half of the word (including the middle letter if there is one). Specifically, if the first half of the word does contain a 't' or a 'T', your program should output a 1. If the first half does not contain the letter 't' or 'T', but the second half does, then your program should output a 2. Otherwise, if there is no 't' or 'T' in the word at all, your program's output should be -1. You may assume that the word entered does not have more than 50 letters.CODE USING C++ Did you know that in lotteries, a 3-digit number with the same numbers in all digits like 777 will hit the jackpot in a casino? In the same manner, let's make a program that will test if a certain 3-digit number hits a jackpot or not by identifying if all the digits of a given number is the same as the second inputted number. If it is, print "Jackpot!"; else, print "Nah". Let's try this out now! Input A line containing two integers separated by a space. 777·7 Output A line containing a string. Jackpot!
- C++ Programming Exercise: A real estate office handles, say, 50 apartment units. When the rent is, say, $600 per month, all the units are occupied. However, for each, say, $40 increase in rent, one unit becomes vacant. Moreover, each occupied unit requires an average of $27 per month for maintenance. How many units should be rented to maximize the profit? Write a program that prompts the user to enter: a. The total number of of units. b. The rent to occupy all the units. c. The increase in rent that results in a vacant unit. d. Amount to maintain a rented unit. The program then outputs the number of units to be rented to maximize the profit.You can find out how many seconds have elapsed since Jan 1, 1970 using the time() function. #include <time.h> now = time(NULL); // now is more than a billion seconds (which data type should you use?) Write a program that estimates how many years, months, weeks, days, and hours have gone by since Jan 1 1970 by calculations with the number of seconds that have passed. The number of months must be less than 12, i.e., take out how many years have gone by first, then how many months are left, then weeks, etc. Assume that all years have 365 days, and all months have 30.42 days. Don’t use a calculator, or any web site that reports the number of seconds in a month, etc. – your C program can calculate anything that you need. Notice that this is an assignment on using arithmetic in C. Hints. How many seconds are in a minute? hour? A day? A week? A month? A year?An oil slick occurs when an underwater refinery pipe ruptures, pumping oil into the water. The spilled oil sits on top of the water and causes a natural disaster. For simplicity, suppose that the oil sits on top of the water in the form of a circle. Write a program that prompts the user to enter the rate at which the ruptured pipe pumps oil (in gallons) per minute, the thickness of the oil on top of the water, and the number of days for which the area is covered by the spilled oil. The program outputs the spilled area (in kilometer) and the volume of oil (in gallons) on top of the water after each day.
- (Modify) a. Modify the program you wrote for Exercise 7 to provide the mass of a person as an output, given his or her weight as an input to the program. Use your program to determine the mass of a person who weighs 140 lbf on Earth. b. Modify the program written for Exercise 7a to also output the person’s weight on Mars and the moon. The pull of gravity on Mars is 12.54ft/sec2=3.728m/s2,andonthemoonis5.33ft/sec2=1.625m/s2.(Statistics) This is the formula for the standard normal deviate, z, used in statistical applications: z=(X)/ X is a single value. refers to an average value. refers to a standard deviation. Using this formula, you need to write a program that calculates and displays the value of the standard normal deviate when X=85.3,=80,and=4. a. For this programming problem, how many outputs are required? b. How many inputs does this problem have? c. Determine a formula for converting input items into output items. d. Test the formula written for Exercise 7c, using the data given in the problem.Use C++ Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies. Ex: If the input is: 0 (or less than 0), the output is: No change Ex: If the input is: 45 the output is: 1 Quarter 2 Dimes
- A university recently conducted a survey with regards to demographics and programmes in which students are enrolled. To this end, they asked 15 students the following questions: In what programme are you enrolled? Responses are C for Civil Engineering, I for ICT, M for Mechanical Eng., P for Process & Utilities. Note that the response could be in any case. What is your age? Write a C program to input this data for the 15 students and to output (a) the percentage of students who enrolled in ICT, and (b) the percentage of students who are enrolled in Civil Eng. and who are under the age of 30. Use the switch statement in your program.Use C++ Write a program that simulates flipping a coin to make decisions. The input is how many decisions are needed, and the output is either heads or tails. Assume the input is a value greater than 0. Ex: If the input is: 3 the output is: heads tails heads For reproducibility needed for auto-grading, seed the program with a value of 2. In a real program, you would seed with the current time. In that case, every program's output would be different, which is what is desired but can't be auto-graded. Note: A common student mistake is to call srand() before each call to rand(). But seeding should only be done once, at the start of the program, after which rand() can be called any number of times. Your program must define and call the following function that returns "heads" or "tails".string HeadsOrTails()Hi, I need help with the following assignment. Implement a program that reads in a year and outputs the approximate value of a Ferrari 250 GTO in that year. Use the following table that describes the estimated value of a GTO at different times since 1962. Year Value 1962-1964 $18,500 1965-1968 $6,000 1969-1971 $12,000 1972-1975 $48,000 1976-1980 $200,000 1981-1985 $650,000 1986-2012 $35,000,000 2013-2014 $52,000,000