Write an algorithm that computes the Body Mass Index (BMI) given the heights and weights of students. The algorithm should first read the total number of students and then read the height and weight of each student to calculate and print the BMI category. A student is considered Underweight if the BMI is less than or equal to 18.5; Normal Weight if between 18.5 and 24.9; Overweight if between 25 and 29.9; and Obese if greater than or equal to 30.
Q: Let p be “It is cold” and let q be “It is raining”. Give a simple verbal sentence which describes…
A: Here in this question we have given some statement and we have asked to write verbal sentense…
Q: The following algorithm yields the season (Spring, Summer, Fall, or Winter) for a given month and…
A: 1) Below is Python program that prompt user for a month and date and print season(Spring, Summer,…
Q: A program for entering a number. If 2 points the number is greater than 100, it prints the number,…
A: Ans-: 1) option (a) 2) false 3) option (a)
Q: In a program, "write the program's algorithm(algorithm like step by step, not code)" that calculates…
A: Note: Only the algorithm is asked and not the code, Below is the algorithm for the same.
Q: The following algorithm yields the season (Spring, Summer, Fall, or Winter) for a given month and…
A: The program demonstrates if else statement in Python. Also another approach is the switch case too.…
Q: Q1:Write an algorithm for printing numbers less than a given number (n) that are divisible by 5.…
A: ALGORITHM:- 1. Take input for the value of n from user. 2. Traverse from 1 to n-1. 3. Check if the…
Q: Turing Machine Design a Turing Machine (M1) that takes any string as input (except the empty…
A: Answer Part 1 The required TM is shown below: Part 2 A TM can be formally described as a…
Q: Write an java program to determine insurance company payment and your payment You may assume that…
A: Algorithm: Read Totalcharges. Read no_of_prescriptions Read amount_of_prescription IF Totalcharges…
Q: Homework write a program that will add the terms of an infinite geometric series. The program should…
A: correct Code:-
Q: A group of monkeys have N bananas in day 1. In the next each day, these monkeys eat half the number…
A: For this, first lets take an examplewith d= day which is givenn = no of banana left on day d Let d =…
Q: Re-write the algorithm below so that it correctly solves the problem. Briefly explain the error and…
A: Average of a group of numbers = ( sum of all the numbers ) / ( count of Numbers ) . so, For Above…
Q: A customer has 500 NIS cash money and wanted to buy some items from a market. Design an algorithm…
A: Answer in step2
Q: A salesman in XYZ company is selling toothpaste for P89.75 each and tooth powder for P155.95 each.…
A: ALGORITHM Step 1 : Start Step 2: Input Customer_name , toothpaste_number and toothpowder_number.…
Q: 3. Write an algorithm that inputs a student's score outputs his grade according to the following:…
A: Algorithm: if (-1<score<60) { grade = "F"; } else if (59<score<70) { grade = "D"; } else…
Q: Write an algorithm that reads 10 integer numbers and calculates the average for numbers that are…
A:
Q: Write an algorithm that accepts a 2-digit number ranging from 20 to 99 and display all pair of…
A: Write an algorithm that accepts a 2-digit number ranging from 20 to 99 and display all pair of…
Q: Write an algorithm that lets the user enter several items prices (number of items is unknown)(when…
A: 1)Start 2)initialize number_of_items=0;sum_of_all_prices=0;highest_price=0;lowest_price=100000…
Q: 4. Write an algorithm that reads two values, determines the largest value and prints the largest…
A: Algorithm is a step-by-step procedure to solve a particular problem. The algorithm gives the logic…
Q: A positive integer is called a perfect number if it is equal to the sum of all of its positive…
A: program code: import java.util.*;public class Main { public static void main(String[] args) {…
Q: shows how to write a program to factor a polynomial of the form x² + bx + c, where b and c are…
A: #include <iostream>#include <cmath>using namespace std;int main() {float a, b, c, x1,…
Q: Write a program in python Zeller’s congruence is an algorithm developed by Christian Zeller to…
A: Use switch that will return 0 : "Saturday", 1 : "Sunday", 2 : "Monday", 3 :…
Q: Suppose that the first number of a sequence is x, where x is a non-zero positive integer. We define…
A: #include <iostream>using namespace std; int main(){ char hims; do{ cout…
Q: For this homework assignment, you are asked to design an algorithm to compute the employee's bonus…
A: Explanation: This program uses 2 inputs bonus schedule overtime and absent bonus paid. The hours…
Q: Print the words in alphabetical order.
A: The program is written in HTML and Javascript. Please check the source code and output in the…
Q: Our local bank has many customers who save their change and bring it in for deposit Write a general…
A: ALGORITHM:- 1. Take input for the customer details. 2. Take input for the currency input from user.…
Q: Write an algorithm that asks the user to enter an integer number then prints the sum of even digits…
A: Aim: To create a program that print addition of all the odd digits of a number and even digits of…
Q: Write this program with Python. Ask the user to enter a month with Zeller’s Algorithm, in text (e.g.…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: Write a program that inputs a sentence from the user and counts the number of words and characters…
A: Given below is the program in C++:
Q: Max Jones belongs to a CD (compact disc) club that allows him to buy CDs at a much lower price than…
A: Algorithm: Step 1: Get the total number of CD's purchased from the user. (Input num_CDs) Step 2:…
Q: A positive integer is called a perfect number if it is equal to thesum of all of its positive…
A: Program approach: We are using java language to create the code of the given problem. code of the…
Q: Create the algorithm for the following problem: A company is giving out bonus to the employees…
A: Here we bonus rate is given by bonus rate = numofYears /100 Now here first we need to accept number…
Q: arts by choosing a value x, as a first estiman cond, more accurate solution x, can be ca thich is…
A: The code is shown as,
Q: .In a scheduling program, we want to check whether two appointments overlap. For simplicity,…
A: Flow chart is the pictorial representation of the flow of a program
Q: Design a program with an algorithm that will take a string from the user and then decide if each…
A: Run 2 loops with variable i and j. Compare str[i] and str[j]. If they become equal at any point,…
Q: Write an algorithm that finds and prints the sum of all positive even numbers as well as the sum of…
A: Below I have provided a c program According to the requirements of the question. You need to find…
Q: Phyton: Make a program that is useful to determine if the integers X, Y and Z, provided by the…
A: X=int(input()) Y=int(input()) Z=int(input()) if(X+Y>Z): if(Y+Z>X):…
Q: The algorithm read 2000 numbers (positive and negative). Your algorithm has to print either…
A: I am writing this code in C++
Q: Write the algorithm and draw the flow chart to read the grades of first-year students in the…
A: Start Initialize succesfulStudents, failStudents to 0 For 225 times Initialize sum to 0 For 7…
Q: Homework write a program that will add the terms of an infinite geometric series. The program should…
A: Here is the code with output:-
Q: Goal: This task prints out each character in a string and then prints it in reverse with spaces…
A: Use for loop to iterate for each character And then use another loop to iterate from ending
Q: A right triangle can have sides that are all integers. The set of three integer values for the sides…
A: The complete code is given in next step along with comments
Q: ii) Write an algorithm for a program that reads a word and prints whether it is short (fewer than 5…
A: Java Source Code import java.util.Scanner; public class WordProperties {…
Q: Write an algorithm that computes the Body Mass Index (BMI) given the heights and weights of…
A: Dear Student, The algorithm for above question is given below.
Q: 4. A primary school is conducting a survey on the popularity of certain colours. Students ar asked…
A: The algorithm is a collection of a finite number of steps to perform a specific task. An algorithm…
Q: Write the algorithm and its equivalent Python program to score the “paper-rock-scissor” game. Each…
A: The algorithm is given below. Iterate while loop with true case Input user choice Convert in into…
Q: Any customer whose total purchase is at least P1000 will be given a 10% discount. Make an algorithm…
A: Below is the pseudocode of given program //ask user to enter purchase amountstartREAD…
Q: A cloth showroom has announced the following seasonal discounts on purchase of items. Purchase…
A: We use if statement within the switch statement. Algorithm Start. Prompt menu to press 1. for Mill…
Q: Write a pricing algorithm for item A and the amount you bought. The algorithm shows the cost,…
A: 1) Read the item A price from the user 2)Read the amount brought from the user
Step by step
Solved in 4 steps with 1 images
- Celebrity problem A celebrity among a group of n people is a person who knows nobody but is known by everybody else. The task is to identify a celebrity by only asking questions to people of the form: ”Do you know him/her?” Solution Select two people from the group given, say, A and B, and ask A whether A knows B. If A knows B, remove A from the remaining people who can be a celebrity; if A doesn’t know B, remove B from this group. Solve the problem recursively for the remaining group of people who can be a celebrity Which design strategy does the following solution use? A-)Decrease-by-a-constant factor algorithm B-)Variable-size-decrease algorithm C-)Decrease-by-a-constant algorithm D-)Divide-and-ConquerSummary Interest on a credit card's unpaid balance is calculated using the average daily balance. Suppose that netBalance is the balance shown in the bill, payment is the payment made, d1 is the number of days in the billing cycle, and d2 is the number of days payment is made before billing cycle. Then, the average daily balance is: averageDailyBalance = (netBalance * d1 payme If the interest rate per month is, say, 0.0152, then the interest on the unpaid balance is: interest averageDailyBalance * 0.0152 Instructions Write a program that accepts as input netBalance, d1, payment, d2, and interest rate per month ( interestRate).Computer Science Question LabThere is only one list of N ingredients in the menu. Every ingredient has its beauty value that does not depend on its taste, but on the way it looks, which is expressed as a positive integer. To order a dish, the customer asks Ramsay to use all the ingredients from L to R (L is strictly less than R). Ramsay knows that the dish will be tasty and not only beautiful if the sum of its ingredients' beauty values is divisible by K. Ramsay does not want to use all the ingredients, so he always excludes one of them. Which one? - The least beautiful one! (in other words - which has the minimal beauty value). Now he wonders - how many segments (L,R) are there such that the sum of their beauty values will be divisible by K after excluding the least beautiful ingredient. Your assignment is to develop a python code that prints the answer for the problem. Sample test case are given below:Input:3 51 2 30utput:1
- 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. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also, indicate if the (primary) highway runs north/south or east/west. 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 Or any number not between 1 and 999, the output is: 0 is not a valid interstate highway number. import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int highwayNumber; int…Computer Science Question Lab There is only one list of N ingredients in the menu. Every ingredient has its beauty value that does not depend on its taste, but on the way it looks, which is expressed as a positive integer. To order a dish, the customer asks Ramsay to use all the ingredients from L to R (L is strictly less than R). Ramsay knows that the dish will be tasty and not only beautiful if the sum of its ingredients' beauty values is divisible by K. Ramsay does not want to use all the ingredients, so he always excludes one of them. Which one? - The least beautiful one! (in other words - which has the minimal beauty value). Now he wonders - how many segments (L,R) are there such that the sum of their beauty values will be divisible by K after excluding the least beautiful ingredient. Your assignment is to develop a python code that prints the answer for the problem. Sample test case are given below:Input:3 51 2 3Output:1Introduction Some number of teams are participating in a race. You are not told how many teams are participating but you do know that: Each team has a name, which is one of the uppercase letters A-Z. No two teams have the same name, so there are a maximum number of 26 teams. Each team has the same number of members. No two runners cross the finish line at the same time – i.e. there are no ties. At the end of the race we can write the results as a string of characters indicating the order in which runners crossed the finish line. For example: ZZAZAA We can see there were two teams: A and Z. Team A’s runners finished in 3rd, 5th and 6th place. Team Z’s runners finished in 1st, 2nd and 4th place. Scoring the race Each runner is assigned a score equal to their finishing place. In the example above team Z’s runners achieved scores of 1, 2 and 4. Team A’s runners scores were 3, 5, and 6 respectively. The team’s score is the sum of the members score divided by the number of people on…
- Rent A Van wants a program that calculates the total cost of renting a van. Customers pay a base fee plus a charge per mile driven. Complete an IPO chart for this problem. Desk-check the algorithm using $50, $0.20, and 1000 as the base fee, charge per mile, and number of miles driven, respectively. Then desk-check it using your own set of dataWhen you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making periodic payments over a certain period of time. Of course, the lending company will charge interest on the loan. Every periodic payment consists of the interest on the loan and the payment toward the principal amount. To be specific, suppose that you borrow $1,000 at an interest rate of 7.2% per year and the payments are monthly. Suppose that your monthly payment is $25. Now, the interest is 7.2% per year and the payments are monthly, so the interest rate per month is 7.2/12 = 0.6%. The first months interest on $1,000 is 1000 0.006 = 6. Because the payment is $25 and the interest for the first month is $6, the payment toward the principal amount is 25 6 = 19. This means after making the first payment, the loan amount is 1,000 19 = 981. For the second payment, the interest is calculated on $981. So the interest for the second month is 981 0.006 = 5.886, that is, approximately $5.89. This implies that the payment toward the principal is 25 5.89 = 19.11 and the remaining balance after the second payment is 981 19.11 = 961.89. This process is repeated until the loan is paid. Write a program that accepts as input the loan amount, the interest rate per year, and the monthly payment. (Enter the interest rate as a percentage. For example, if the interest rate is 7.2% per year, then enter 7.2.) The program then outputs the number of months it would take to repay the loan. (Note that if the monthly payment is less than the first months interest, then after each payment, the loan amount will increase. In this case, the program must warn the borrower that the monthly payment is too low, and with this monthly payment, the loan amount could not be repaid.)Interest on a credit card’s unpaid balance is calculated using the average daily balance. Suppose that netBalanceis the balance shown in the bill, paymentis the payment made, d1is the number of days in the billing cycle, and d2is the number of days payment is made before the billing cycle. Then the average daily balance is: averageDailyBalance = (netBalance * d1 –payment * d2) / d1 if the interest rate per month is say, 0.0152, then the interest on the unpaid balanceis: interest = averageDailyBalance * 0.0152 Design a program that accepts as input netBalance, payment, d1, d2, and interest rate per month. The program outputs the interest charged. Format your output to two decimal places. C++
- Tutorial 3: A simple force balance on a spherical particle reaching terminal velocity in a fluid is given by; |4g(P, -p)D, V : 3C,p Where Solution by Visual Basic V Terminal velocity in m/s g: Acceleration of gravity Pp: Particle density Dp: The diameter of the spherical particle in m CD: Dimensionless drag coefficient. The drag coefficient on a spherical particle at terminal velocity varies with Reynolds number (Re) as followings: Cp=24/Re Cp=24*(1+0.14* Re^0.7)/Re Cp=0.44 Cp=0.19-80000/Re Where, Re =(D, Vi p)/u =994.6 kg/m3 µ=0.0008931×kg/m.s. Calculate the terminal velocity of spherical particle using visual basic program? for Re< 0.1 for 0.1=Assignment Write a program that tracks how much steps the user walks in total in a day and reports if the daily target is reached or not. The program will keep reading double values, each representing steps walked during an individual activity within a day (stepsWalked) until either the user enters a negative value or the daily target of 5000 steps is met. If the user enters a negative number, the program should print total steps walked as a double. Otherwise, if the target is exactly reached, the program should simply print "Target is reached", finally if the target is surpassed the program should print the text "Target is surpassed by", followed by the excess amount above the target as a double, and finally printing the text "steps". NOTE: You MUST use a repetitive statement in this question. NOTE: Each stepsWalked value will be given as a non-negative value. You do NOT need to check this. Input Output Answer assignment 3000 1300 500 2305.2 Target is surpassed by 2105.2 steps 450…An Auto Insurance Program Example - Write a program to determine the cost of an automobile insurance premium, based on driver's age and the number of accidents that the driver has had. The basic insurance charge is 500 Rs. There is a surcharge of 100 Rs if the driver is under 25 and there is an additional surcharge for accidents as can be seen below: No. of accidents Accident Surcharge 1 50 2 125 3 250 4 375 5 575 6 or more No insuranceSEE MORE QUESTIONS