write a pseudo code and read a patient number, blood pressure figures (systolic or diastolic), and two cholesterol figures (LDL and HDL). Include a method named computeRatio() that divides LDL cholesterol by HDL cholesterol and displays the result. Include an additional method named explainRatio() that explains that HDL is knowns as “good cholesterol” and that a ratio of 3.5 or lower is considered optimum.
Q: This method simulates the playing of one round of “Rock Paper Scissors”. In this strange version of…
A: Below is the required program: - Approach: - Import the package to use the Scanner class and define…
Q: Write a method that takes a String name parameter. The method asks the user to input an hour value.…
A: The method accepts a String which is name It prompts user for hours If hours<12 then it's morning…
Q: Write a code snippet to prompt a user to enter two words. Then, pass these values as parameters in a…
A: Start. Read two words. Pass these two to the functions. Check for the number of upper and lowercase…
Q: 8. Create a new method that takes two integer values (current month, birth month) as parameters and…
A: Please refer below code and screenshot: function check(current_mon,birth_mon){ val=0;…
Q: This method simulates the playing of one round of “Rock Paper Scissors”. In this strange version of…
A: Below is the complete Java program: - Approach: - Import the package to use the Scanner class and…
Q: 3. Write a method called sum that accepts two parameters min and max, this method finds the sum of…
A: import java.util.*;public class Main{ static int sum(int min,int max) { int sum = 0;…
Q: 2. Write a program that simulates tossing a coin. Prompt the user for how many times to toss the…
A: 2. Write a program that simulates tossing a coin. Prompt the user for how many times to toss the…
Q: Write a method named method1 that accepts two parameters: a maximum number and a number of stars.…
A: Program code: //import the required packages import java.util.Scanner; //define a class Main class…
Q: A programmer notices that the following code snippet uses the same algorithm for computing cost…
A: ANSWER:Define a function that computes the interest earned from an amount and a rate of interest.
Q: a) Write a method that calculates the result of the following formula: x² + (x + k}°+ (x + 2k) + (x…
A: The code in java has been given in step 2.
Q: method named getTotal that accepts two integers as an argument and return its sum. Call this method…
A: #include <iostream>using namespace std;class Math{public:int getSum(int a, int b);};int…
Q: Write a method called friendlyNumbers that accepts two 4-digit integer parameters n1 and n2. The…
A: Code public class Main{ public static void main(String[] args) { friendlyNumbers(3451,3981); }…
Q: You are given a date. You just need to write the method, getDay, which returns the day on that date.…
A: The following is the required Java program:- // A Java program to find day of a given date import…
Q: The following methods should output simple text messages on the screen for feedback, when…
A: As the student only asked about the plane class. Im Providing the Plane Class in Java Program below:
Q: a) Write a method that calculates the result of the following formula: x2 + (x + k)² + (x + 2k)? +…
A: import java.util.Scanner;import java.lang.Math; public class Main{ public static void sum(double…
Q: Write a method called isMultipleOfSeven which takes one integer parameter and returns a boolean…
A: Here, first you need to check if number is divisible by 7 or not in "isMultipleOfSeven()" method. As…
Q: Write a program for an artist who is creating art instillation “experiences” consisting of rooms…
A: The program is completed with java. first of all, we take all the user input of width, length,…
Q: Write a method named method1 that accepts two parameters: a String name and a separator (character).…
A: Given:
Q: A programmer notices that the following code snippet uses the same algorithm for computing cost…
A:
Q: Write a method called Input that has four double parameters x1, x2,x3, and x4. The method should…
A: Given that Write a method called Input that has four double parameters x1, x2,x3, and x4. The method…
Q: Create a program in Java called TicketPurchase. Create a method called receipt that will print each…
A: The program is written in java. Please check the source code and output in the following steps.
Q: The following code is poorly structured. Rewrite it so that it has a better structure and avoids…
A: Source code: public void spending(Scanner console,String name) { System.out.print("How much will " +…
Q: If the value passed into the parameter x in the following method is 10. What is the value returned…
A: 3840 First it will take x as 10 Here i=10;10>0 so true enter into for block Y=1*10 = 10 now…
Q: Question 2 Write a method int countMultiplesofFive (int x, int y) that returns the number of…
A: Given:
Q: I need help writing a program using the DrawingPanel that contains a method for drawing a…
A: The program creates a new drawing panel, named panel, of height and width 160. To draw shapes on the…
Q: Write a method called method2 that takes an int height and an int side in as parameters. Use the two…
A: import java.util.Scanner; import java.lang.Math; public class Test{ publicstaticvoidmain(String…
Q: Write a method that returns the number of days in ayear using the following header:public static int…
A: 1. There are only two total numbers of days in a year possible. 365 days and 366 days. 2. The total…
Q: Write the definition of a method that takes as input three numbers and returns the sum of the first…
A: Method definition sumandproduct()method takes three double values as input and returns double value.…
Q: Write a method named raiseSalary that accepts two integers as an argument and returns its sum…
A: Function:- public static double raiseSalary(int firstInt,int secondInt){ int…
Q: Given a method named getRandomNumber that has no parameters and returns a random int value, call the…
A: Lets discuss the solution in the next steps
Q: Write a program that asks the user to enter an item’s wholesale cost and its markup percentage. It…
A: The program is written in C#
Q: I need help writing the code. Write a public static method named odds that takes in 1 argument int…
A: Function odds() contains following condition: if a is 0, then return " "; if a <= -1, return…
Q: You need to read in and process the wind speeds in East London over the past few days. The maximum…
A: The methods including parameters are given. Minimum 4 to 8 reading are required from the user as…
Q: Write method called sumEven that has two integer parameters num1 and num2, which represent a range…
A: //importing Scanner for taking user input import java.util.Scanner; //sum class definition public…
Q: You are asked to write a Java method that receives the Information Systems Department plan for first…
A: In questions with many questions, we must answer the first one.
Q: Write a program that simulates tossing a coin. Prompt the user for how many times to toss the coin.…
A: Program Algorithm-STARTStep1 Import the essential java packages.Step2 Define a Class MainStep3…
Q: 2. Write two (2) overloaded methods that will compute the total price of an item. Use the total item…
A: Step-1: Start Step-2: Create a class Program Step-2.1: Create a function priceOfItems and item &…
Q: Write a method that prompts a student to enter a score. If the score is greater or equal to 60,…
A: Note: Assume that the below program ends with the input "-1". If you wish to end the program with…
Q: 1. Write a program that will ask the a user a number between 1 to 7. 2. Print out the equivalent…
A: The below given C++ program will obey the following rubrics: Including the necessary header file.…
Q: a) Write a boolean method called productDivisibleByThree that returns true if the product of the…
A: Note: As per our guidelines, we are supposed to answer only one question. Kindly repost other…
Q: program that asks the user to enter an item’s wholesale cost and its markup percentage. It should…
A: Markup refers to the difference between the selling price of a good or service and its cost. It is…
Q: Here are the original instructions for the code below that I wrote. Write a method that accepts a…
A: For input from the input console or keyboard, an object of the Scanner class is declared. Using the…
Q: A pentagonal number is defined as n(3n-1)/2 for n = 1, 2, …, and so on. Therefore, the first few…
A:
Q: Write a method that takes your name and your expected year of graduation and prints that information…
A: Given: Write a method that takes your name and your expected year of graduation and prints that…
Q: Write a method called method3 that accepts a string as it parameter and prints each letter of the…
A: PROGRAM: //Defining class class Main { //Defining main() public static void main(String[]…
Q: method simulates the playing of one round of “Rock Paper Scissors”. In this strange version of the…
A: Rock, Paper, Scissors (sometimes called roshambo) has been a staple to settle playground…
Q: Write a method triangleArea() which a receives as input two integers representing the base length…
A: NOTE:- As the language is not mentioned. So, the program is done using C language. CODE:- #include…
write a pseudo code and read a patient number, blood pressure figures (systolic or diastolic), and two cholesterol figures (LDL and HDL). Include a method named computeRatio() that divides LDL cholesterol by HDL cholesterol and displays the result. Include an additional method named explainRatio() that explains that HDL is knowns as “good cholesterol” and that a ratio of 3.5 or lower is considered optimum.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images
- Question 2 Write a method int countMultiplesofFive (int x, int y) that returns the number of multiples of 5 bounded between x and y inclusive. In the main, ask the user to enter two positive numbers (both must be positive, if users enter a negative value, they keep reentering values until both numbers are positive). Use the method countMultiplesofFive to find and print how many multiples of 5 exists between the two entered numbers inclusive. Sample run 1: First random: 11 Second random: 80 There are 14 umber that are multiple of five between 11 and 80 Sample run 2: First random: 75 Second random: 33 There are 9 number that are multiple of five between 33 and 75You are responsible for adding the appropriate testing code to your main. a. The getValedictorian method returns the valedictorian of the class, that is the student with the highest grade point average. Implement this new method. b. The getHonorsPercent method returns the percentage of students in the class who are in the honors program. Use 3.75 as the cutoff GPA. Implement this method. Also print the list of students, by using the isHonor method, in the Honors program. c. An alternate implementation for the School class is being considered, in which the students are stored in an ArrayList instead of an array. Show how the declaration of the data field students would look in this alternate design. MAIN CLASS: import java.util.ArrayList; public class Main { public static void main(String[] args) { System.out.println("Unit07Project2 by Your Name"); System.out.println(); int size = 10; School onw = new School(size); /* Add the code…Write a method that returns the number of days in ayear using the following header:public static int numberOfDaysInAYear(int year)Write a test program that displays the number of days in the years between 2014and 2034.
- We need a program that calculates a medicine dosage by age. The following table states the amount of mg according to age ranges: AGE DOSE 1-5 years Greater or equal to 5 (MG) 100 220 Write a method int findDose(int nbyears) that takes the number of years and returns the dose in mg. Write a test program that asks the user to enter the number of years (a positive, non-zero value) and prints the dose.We will rewrite the Sales Bar Chart question to use method for printing out the bar chart. The part where the asterisks are printed out should be done with a method. Use this method for each bar. The original question statement is here: Write a program that asks the user to enter today’s sales for five stores. The program should display a bar chart comparing each store’s sales. Create each bar in the bar chart by displaying a row of asterisks. Each asterisk should represent $100 of sales. Here is an example of the program’s output: Enter today's sales for store 1: 1000 [Enter] Enter today's sales for store 2: 1200 [Enter] Enter today's sales for store 3: 1800 [Enter] Enter today's sales for store 4: 800 [Enter] Enter today's sales for store 5: 1900 [Enter] SALES BAR CHART Store 1: ********** Store 2: ************ Store 3: ****************** Store 4: ******** Store 5: *******************Assume you are working as a developer in a bank, and you have been asked to develop a programto validate credit card numbers. Assume also that each credit card number consists of 8 digits. Thefollowing method is used to verify that the credit is valid or not: - Starting from the rightmost digit, form the sum of every other digit. For instance, if thecredit card number is 43589795, then you form the sum 5 + 7 + 8 + 3 = 23. - Double each of the digits that were not included in the preceding step. Add all digits of theresulting numbers. Considering for example the above credit card number 43589795,doubling the digits starting from the next-to-last one, yields 18 18 10 8. Adding all digitsin these values yields 1 + 8 + 1 + 8 + 1 + 0 + 8 = 27 - Add the sum of the two preceding steps. If the last digit of the resulting sum is 0, the creditcard number is valid; otherwise, it is invalid. In our case, 23 + 27 = 50, so the number isvalid. Write an Algorithm and Flowchart draw.
- Assume you are working as a developer in a bank, and you have been asked to develop a programto validate credit card numbers. Assume also that each credit card number consists of 8 digits. Thefollowing method is used to verify that the credit is valid or not: - Starting from the rightmost digit, form the sum of every other digit. For instance, if thecredit card number is 43589795, then you form the sum 5 + 7 + 8 + 3 = 23. - Double each of the digits that were not included in the preceding step. Add all digits of theresulting numbers. Considering for example the above credit card number 43589795,doubling the digits starting from the next-to-last one, yields 18 18 10 8. Adding all digitsin these values yields 1 + 8 + 1 + 8 + 1 + 0 + 8 = 27 - Add the sum of the two preceding steps. If the last digit of the resulting sum is 0, the creditcard number is valid; otherwise, it is invalid. In our case, 23 + 27 = 50, so the number isvalid. 7. On Private Sub Frm_Your_Id_Load(sender As…Assume you are working as a developer in a bank, and you have been asked to develop a programto validate credit card numbers. Assume also that each credit card number consists of 8 digits. Thefollowing method is used to verify that the credit is valid or not: - Starting from the rightmost digit, form the sum of every other digit. For instance, if thecredit card number is 43589795, then you form the sum 5 + 7 + 8 + 3 = 23. - Double each of the digits that were not included in the preceding step. Add all digits of theresulting numbers. Considering for example the above credit card number 43589795,doubling the digits starting from the next-to-last one, yields 18 18 10 8. Adding all digitsin these values yields 1 + 8 + 1 + 8 + 1 + 0 + 8 = 27 - Add the sum of the two preceding steps. If the last digit of the resulting sum is 0, the creditcard number is valid; otherwise, it is invalid. In our case, 23 + 27 = 50, so the number isvalid. Write a C++ program to validate credit card number using…Write a method thatcomputes future investment value at a given interest rate for a specified numberof years. Use the following method header:public static double futureInvestmentValue(double investmentAmount, double monthlyInterestRate,int years)For example, futureInvestmentValue(10000, 0.05/12, 5) returns12833.59.Write a test program that prompts the user to enter the investment amount (e.g.,1,000) and the interest rate (e.g., 9%) and prints a table that displays future valuefor the years from 1 to 30, as shown below: The amount invested: 1000Annual interest rate: 9Years Future Value1 1093.802 1196.41...29 13467.2530 14730.57
- 1. Write a program that will ask the a user a number between 1 to 7. 2. Print out the equivalent day of the week for that number. Starting 1 for Sunday, 2 for Monday and etc. 3. Use at least 1 user-defined method aside from your main method in writing a code for this problem (Input number: Expected Output: )Wrtie TWO methods pass number of birds and print number of birds in California (method1) and birds in Texas (Method 1) Print the total of birds. You can use void method.Please help me! I have a lot of mini problems. I'm not sure how to start After #6, I have other problems. Those are : 7.) Write a method that reads a one-line sentence as input and then displays the following response: If the sentence ends with a question mark (?) and the input contains an even number of characters, display the word Yes. If the sentence ends with a question mark and the input contains an odd number of characters, display the word No. If the sentence ends with an exclamation point (!), display the word Wow. In all other cases, display the words You always say followed by the input string enclosed in quotes. Your output should all be on one line. Be sure to note that in the last case, your output must include quotation marks around the echoed input string. In all other cases, there are no quotes in the output. Your program does not have to check the input to see that the user has entered a legitimate sentence. Notes: This code requires a three-way selection statement and…