Value returning method Write a program to calculate items sale price
Q: True or False: When passing multiple arguments to a method, the order in which the arguments are…
A: Given: True or False: When passing multiple arguments to a method, the order in which the arguments…
Q: NumberFormat static method ---------- returns a ---------- NumberFormat that’s used to format a…
A: GIVEN: NumberFormat static method ---------- returns a NumberFormat that’s used to format a number…
Q: Complete the following program so it performs the following actions 10 times:• Generates a random…
A: import java.util.*;//Create a main class "ReviewQuestion16 public class ReviewQuestion16{ public…
Q: (Prism Program) Write a program that can calculate the value of the surface area and volume of a…
A: As Programming language is not mentioned, taking C as reference. Inputs : Lenght, Width and Height…
Q: A __________ belongs to the method in which it is declared, and only statements inside that method…
A: Variable belonging to the declared method The local variables are the variables that are declared…
Q: C# LANGUAGE Create a method named getCircleDiameter that takes a radius of double type as the…
A: I give the code in C# along with output and code screenshot
Q: Question 1) Write a method that takes continuously a positive number from the user and then returns…
A: Here, Code instruction is given.
Q: 2.a Create the logic for a program that calculates and displays the amount of money you would have…
A: 1) Below is Pseudocode and Program to calculate the display amount with simple interest for one year…
Q: Guess-the-number-game: Write a program that pays the game of “guess the number” as follows: Your…
A: Since the programming language is not mentioned in the question, we will answer this question in the…
Q: Write a program that accepts the feet value as an argument and returns the corresponding inches…
A: Algorithm : feet_to_inch function : Step 1 : declare variable. Step 2 : find the inch from feet by…
Q: True or False The nouns in a problem description may indicate some of the methods needed in a…
A: In object oriented programming language, if the problem description contains nouns then they may…
Q: A program contains the following value-returning method: private int Square(int value) { return…
A: Since you are not mentioning the programming language, here we are using Java to complete the…
Q: Retail price calculator Write a program that asks the user to enter an item’s wholesale cost and its…
A: Step 1 : Start Step 2 : Define a method calculateRetail() to calculate and return the retail price…
Q: Flowchart, create. Writing Functions with No Parameters in Python #method to display the discount…
A: The program in given below
Q: 7. Test Average and Grade Write a program that asks the user to enter five test scores. The program…
A: The problem is based on the basics of functions in java programming language.
Q: C# Question Write a statement that declares a variable called even and assigns it to the value…
A: Given: C# Question Write a statement that declares a variable called even and assigns it to the…
Q: Description Note: You must use the values given and you must not "hard-code" results. Write a Java…
A: logic:- read n if n>=18 display “person can vote” else display “person cannot vote” end.
Q: Even/Odd Counter You can use the following logic to determine whether a number is even or odd: if…
A: below is the code to generate 100 random integers and display the even and odd numbers. In the…
Q: 5. Falling Distance When an object is falling because of gravity, the following formula can be used…
A: PROGRAM CODE: import java.util.Scanner; // import utility packagepublic class Main…
Q: Code an application that determines how many gallons of water is needed for a pool. Create Void…
A: The program calculates the gallons of water required for completely filling the pool as per user…
Q: public elass Sale public static void nain(String(] arga) int price, tax, total: price- 29 tax 1;…
A: public class Sale{ public static void main(String[] args) { int price, tax, total;…
Q: How do I fix this Python program, so that it does not print "Bye" when program continues but it does…
A: The given python program is: #Interest Rate #This program uses input from the user to calculate the…
Q: 1. Create a Java program with three static methods in addition to the main method 1) Factorial…
A: In the main class declare the static variable n1,n2 and n3. The static method Fibonacci() is defined…
Q: The first method of the class will ask the user to input two numbers. Four methods will return their…
A: The question is to write java code for the given problem.
Q: The Game of Nim Problem Description: Two players alternately take marbles from a pile. In each move,…
A: Program Requirements as per question: The program must define and use the following methods, int…
Q: function/method Write a program that asks the user for his first name and then prints it using a…
A: Code: import java.util.*;public class Main{ void printName(String s){…
Q: Method main: Print the message "Math Quiz". Call method display_menu and assign the return value…
A:
Q: Java programming language. Write a program that checks the number entered by the user, whether it is…
A: Prime Number
Q: program that uses diferent operators; • Use the methods of the Math class. tructions: 1. Create a…
A: here is your Program that uses different operators and uses the methods of the math class.
Q: Write a void method which will print out a sentence “Hello World!”. Call the method from main().
A: In void method, we need to print out a sentence "Hello World! " and also call the method from main…
Q: Create a program that calculates the interest on a loan. This program should make it easy for the…
A: According to the information given: We have to follow the instruction to get the desired outcome-
Q: What is the difference between these two statements? void showValues(int num) void showValues(int…
A: Function overloading: One name multiple forms are the feature of the function overloading. A single…
Q: 29. Fill in the Blanks: A __________ is a collection of statements that are grouped together to…
A: Which of the following options is a collection of statements that are grouped together to perform an…
Q: java-Find the area of circle using method... Write an application that prompts the user for the…
A: import java.util.*;public class Main { public static double circleArea(double r){ return…
Q: Financial application: compute future apartment rent) Suppose that the rent for an apartment is…
A: The problem is based on finding the rent of the apartment using programming. NOTE: The code is…
Q: 24. Word Game Write a program that plays a word game with the user. The program should ask the user…
A: sample output
Q: Constants are variables declared with storing a value on it and this value can be changed during the…
A: Introduction Constants are not variables because these values cannot be changed throughout the…
Q: A method CAN be invoked using a variable that is initialized to null. True False
A: We can invoke a method using a null variable.
Q: java finding Distance Between Points Write method distance used to calculate the distance between…
A: Logic:- input 4 points and pass it a method distance of return type double. Use formula sqrt(…
Q: True or FalseA value-returning method must contain a return statement.
A: Value-returning method: The value-returning method performs the task and does not terminate. The…
Q: You can declare a void method as follow; public void int calculateSalary() { int num1=89; int…
A: WE have to find weather the syntax is correct or not.
Q: Trigonometric method draw circle full code program ask User (Xc,Yc,radius r) in main class
A: Trigonometric method draw circle full code program ask User (Xc,Yc,radius r) in main class Since…
Q: 7. Recursive Power Method Write a method that uses recursion to raise a number to a power. The…
A: import java.util.Scanner;public class MyClass { static long pow(int n,int m) { if(m==1)…
Q: Assignment: Carefully read the instructions and write a program that reads the following information…
A: The following program is compiled in replit and also Eclipse.Pseudo code:Get the inputs from the…
Q: Write a program (use value returning method) that gives simple math quizzes. The program should…
A: Given: Write a program (use value returning method) that gives simple math quizzes. The program…
Q: Test Average and Grade rite a program that asks the user to enter five test scores. The program…
A: Define java.util.Scanner for taking inputs. Define main class. Define main function. Define int…
Q: Last month Joe purchased 100 shares of stock. Here are the details of the purchase: • When Joe…
A: Given: Last month Joe purchased 100 shares of stock. Here are the details of the purchase: • When…
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images
- Random Number Guessing Game Create an application that generates a random number in the range of 1 through 100 and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display “Too high, try again.” If the user’s guess is lower than the random number, the program should display “Too low, try again.” If the user guesses the number, the application should congratulate the user and then generate a new random number so the game can start over. Optional Enhancement: Enhance the game so it keeps count of the number of guesses that the user makes. When the user correctly guesses the random number, the program should display the number of guesses.Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased every month, The points are awarded as follows 1.If a customer purchases 0 books, he or she earns points 0 If a customer purchases 1 books, he or she earns points 5 If a customer purchases 2 books, he or she earns 15 points If a customer purchases 3 books, he or she earns 30 points If a customer purchases 4 or more books he or she earns 60 points Design a program using pseudocode that asks the user to enter the number of books that he or she has purchased this month and displays the number of points awarded . Here are some necessary parameters to follow to help solve the problem. Please write line numbers before each line of the algorithm, include blank numbered lines between modules and write comments 1.Create a main module. It should declare one local variable and call two other modules 2. Create a module to get input from the software user 3.Create a module to…Challenge task The distance a vehicle travels can be calculated as follows: distance = speed * time For example, if a vehicle starts a trip at 10 miles and travels 40 miles per hour for 4 hours, the distance traveled is 170 miles, the first 2 hours the distance=80+10=90, and the second one=160+10=170. Write a program which reads the speed of a vehicle (in miles per hour) and how many hours it has traveled. The program should then use a for loop to display the distance the vehicle has traveled for every 2 hours of that time period. 1 Roserio ףי Constraints None
- Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased every month, The points are awarded as follows 1.If a customer purchases 0 books, he or she earns points 0 If a customer purchases 1 books, he or she earns points 5 If a customer purchases 2 books, he or she earns 15 points If a customer purchases 3 books, he or she earns 30 points If a customer purchases 4 or more books he or she earns 60 points Design a program using pseudocode that asks the user to enter the number of books that he or she has purchased this month and displays the number of points awarded . Here are some necessary parameters to follow to help solve the problem. Please write line numbers before each line of the algorithm, include blank numbered lines between modules and write comments Create a main module. It should declare one local variable and call two other modules Create a module to get input from the software user Create a module to…20. Random Number Guessing GameWrite a program that generates a random number in the range of 1 through 100, and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display “Too high, try again.” If the user’s guess is lower than the random number, the program should display “Too low, try again.” If the user guesses the number, the application should congratulate the user and generate a new random number so the game can start over.Optional Enhancement: Enhance the game so it keeps count of the number of guesses that the user makes. When the user correctly guesses the random number, the program should display the number of guesses. USE RAPTOR PROGRAMSavings Account The following steps calculate the balance after three years when $100 isdeposited in a savings account at 5% interest compounded annually:1. Declare the variable balance as type Decimal.2. Assign the value 100 to the variable balance.3. Increase the variable balance by 5% of its value. (Write 5% as 0.05D.)4. Increase the variable balance by 5% of its value.5. Increase the variable balance by 5% of its value.6. Display the value of balance (rounded to two decimal places) in a list box.
- * Question Completion Status: Moving to another question will save this response. Quèstion 5 Simplified form of F=y +x y+y xz is xy + y + x Z xy + y (1 + y z) xy +y (x+y z) xy +y +xz A Moving to another question will save this response.Function Name: comboLock Parameters: num1 – a positive integer representing the first digit in the combination num2 – a positive integer representing the second digit in the combination num3 – a positive integer representing the third digit in the combination num4 – a positive integer representing the fourth digit in the combination num5 – a positive integer representing the fifth digit in the combination Description: You own a combination lock that only opens when presented with the correct sequence of odd and even numbers that are less than 10. Write a function that takes in 5 integers. Check whether they are in this order: odd, even, odd, even, odd. If they are in the correct order and all below 10, then print the string “You opened the lock.” Otherwise, print “You are locked out.” Test Cases: >>>comboLock(9, 2, 5, 4, 1) You opened the lock. >>>comboLock(1, 8, 3, 6, 8) “You are locked out.” comboLock(2, 2, 5, 6, 4) “You are locked out.” >>>comboLock(9, 8,…Objectives: • Provide a game solution using C++ language. It is important that we can use a set of C++ features to solve problem. • Develop solutions that use class features for C++. • Create "*.h" files and "*.cpp" files for classes. Description: 1. Part 1- Required Assignment: a. Write code for the class GamePurse. It has the following interface Iclass GamePurse { int purseAmount; public: GamePurse(int); void win(int); void Loose(int); int GetAmount(); }; b. Win() function will add a winning amount to the purseAmount. On the other hand, Loose function will deduct an amount from the purseAmount. GetAmount() will return the value of "purseAmount". c. Write a program that allows you to play the dice game repeatedly until the user chooses to quit. User needs to bet a positive amount to play a game. d. The output of the program may be like the following Welcome to the dice ware game. You have 100 in your game purse.
- GreenLawn a local lawn care company has different pricing policies for its customers. GreenLawn sends out monthly invoices and will give discounts if payments are made within 5 days. The discounting policy is as follow: If the amount of the monthly bill is greater than $300, subtract 4 percent from the invoice; if the amount is between $300 and $100, subtract a 2-percent discount; if the amount is less than $100, do not apply any discount. All bills made via the web automatically receive an extra 3-percent discount. Develop a decision for GreenLawn discounting decisions. Decision Table submission: Include the initial table with all rules, and the most simplified table. Use different colors in the columns to easily show how columns are collapsed/simplified. please do not provideo solution in image format thank you!Direction : Make a guessing game program that will generate a random number and ask the user to guess the generated value with at most three (3) attempts: Problem/Required : The system should have the corresponding feature/s: Generate a random value between 1 to 10. Give the user at most 3 attempts to input a value between 1 to 10. Display “Higher” or “Lower” depending on the user’s input compared to the generated value. Display “Sorry, 3 attempts already.” after 3 incorrect attempts, “Congratulations! You got it in n attempt/s” Show the generated number.MULTIPLE CHOICE -The answer is one of the options below please solve carefully and circle the correct option Please write clear .