c# uppose there is a method called Current Deposit is your project class. The method header is as below: public static decimal Current Deposit( in years , decimal future, double rate) This method will return the current amount of money in an account if you pass the future amount, the annual interest rate, and years number. Write one statement to declare a decimal variable myMoney, call the method with the future amount $50,000.00, interest rate 8%, and 15 years, and assign the returned value to myMoney.
Q: Make sure each program has at least one method in addition to its driver method(main). Or use one…
A: import java.util.*;public class Main{ static void GPA() { int A=4,B=3,C=2,D=1,F=0;…
Q: Summary In this lab, you complete a partially prewritten Java program that includes methods with no…
A: Here I have taken input from the user and then stored it into a variable of string type. Next, I…
Q: Distance Traveled ModificationThe distance a vehicle travels can be calculated as follows:…
A: Initially speed of a vehicle is defined as the distance travelled over unit time. i.e Speed =…
Q: True or False: The value of a local variable is retained between method calls.
A: True
Q: Herbert’s Home Repair estimates each job cost as the cost of materials plus $35 per hour while on…
A: import java.uti.Scanner; public class JobPricing{ public static void main(String[] args) {…
Q: Declare an integer variable named "variables with an initial value of 10. // write a method named…
A: Please find the answer below :
Q: use only C# programming Write a method call CubeIt(int x, ref int cube) that takes two arguments…
A: As per the guidelines of Bartleby, we experts are supposed to answer only one question in case of…
Q: JAVA Write a program that calculates the average of courses, overall grade, and letter grade.…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: Design a Java program to find the maximum and minimum of 4 integer numbers by using only the Math…
A: Below is the JAVA code to find the maximum and minimum values of 4 integer values by using the Math…
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: 1. Examine the following method header; then write an example call to the method. private void…
A: A method is a block of code used to perform certain actions. A method is define once, and use…
Q: Write the proper method declaration/ method call for the following (Javaprogramming)
A: 1 ) public static CSIT(int i) { String s=Integer.toString(i) } __________________ 2 ) void…
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: need help creating this Java Program it has to match the sample run exactly thank you !…
A: import java.util.Scanner; public class Main{ public static double futureInvestmentValue(double…
Q: Activities: I. Write the proper method declaration/ method call for the following (Javaprogramming)…
A: A method named IT that does not accept but returns an integer value…
Q: Pass both variables to a method named computePercent() that displays the two values and the value of…
A: Required: Modify the Percentages application whose main() method holds two double variables.…
Q: Herbert’s Home Repair estimates each job cost as the cost of materials plus $35 per hour while on…
A: Code snippet:
Q: Question 2: A student will not be allowed to sit in exam if his/her attendance is less than 75%.…
A: According to the information given:- We have to follow the instruction and code to get desired…
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: Please use Java as programming language Create a class named Commission that includes 3 variables: a…
A: logic:- In first computeCommission(double sales,double commission_rate1) {…
Q: JAVA Q1) class room practice-activity (class & object, methods) Create a class with the following…
A: Programming instructions: Include necessary header files. Create a class BookDetails. In the class,…
Q: In the java.util package there is a class named Calendar. It has a method named getInstance, which…
A: first you need to import java.util.Calendar class create object of Calendar and call getInstance()…
Q: Write a standard mode application that calculates and displays the weekly salary for an employee.…
A: A required program is as follows, import java.util.Scanner; public class Salary { //Define the…
Q: Prime Numbers A prime number is a number that can be evenly divided by only itself and 1. For…
A: The prime number are the numbers that is only divisible by 1 and itself. The prime numbers are 2, 3,…
Q: Java Programming – Lesson 4 Using Methods – Laboratory Exercises 3. Create a class named Commission…
A: Code : public class Commission{ double sales, commRate;int comRate; public static double…
Q: Part B-The Constructor and Method getVowels() (30 – 40 minutes) 1. Driver: Complete the constructor.…
A: Java code to find the vowels present in a given string
Q: Eclipise Exercise 1: Write a Java application that simulates a test. The test contains at least…
A: We can use OOPS based approach to solve the problem:
Q: Java practical 1 It has been realized that hackers have started hacking and changing the account…
A: Find Your Code Below
Q: Activities: I. Write the proper method declaration/ method call for the following (Java Programming)…
A: Answers: 1. public static void CS(){ // statement } 2. CS(); 3. public static int IT(){//statement…
Q: JAVA Q1) class room practice-activity (class & object, methods) Create a class with the following…
A: A method is a section of code that only executes when it is invoked. Parameters are data that can be…
Q: e windChill method accepts the temperature and wind speed as whole numbers and returns the…
A: Here the function windChill is returning a whole number. So return datatype has to be int. The…
Q: Write a Java application that simulates a test. The test contains at least five questions about…
A: Please change questions and correct answers and it's choices in the program according to your…
Q: Math: pentagonal numbers) A pentagonal number is defined as n(3n-1)/2 , for n = 1,2, . . ., and so…
A: Pentagon Class: Pentagon Class contains calcPentagonalNumber() definition which returns pentagonal…
Q: Question 1: Write a java program that has the following methods: • A method called bodyMass that…
A: Here I have defined the function bodyMass(). In this function, I have used nested if-else conditions…
Q: The terms in the formula are as follows: • P is the present value, or the amount that you need to…
A: PROGRAM: //Header file import java.util.*; //Defining class public class Main{ //Defining…
Q: A method is often a void method that changes the values of instance variables or static variables.…
A:
Q: 6.18 Lab: Flip a Coin Define a method named coinFlip that takes a Random object and returns "Heads"…
A: As Language is not defined doing it in Java Language:
Q: Methods with an empty parameter list and do not return a value: [Questions 1-8 required] You invoke…
A: Coded using C#.
Q: JAVA PROGRAMMING Create a class whose main() holds two integer variables. Assign values to the…
A: - We need to create the java code for sum and product using functions.
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: Exercise 6.14 JHTP: (Variable-Length Argument List) Write an application that calculates the product…
A: Solution:: Exercise 6.14 Code Screenshot : Executable Code: public class…
Q: Please don;t change anything. put your code line 5. Java Write a static method named toCelsius that…
A: Below is the static method of converting fahrenheit to celsius in java.
Q: Plan the logic for an insurance company program to determine policy premiums. The program…
A: a) The following code is designed for an insurance company which input type of policy from customer…
Q: Create a method that randomly select a letter in the alphabet. java
A: Please find the answer below :
Q: ppose myCar is the name of a class variable that references an object, and go is the name of a…
A: Given :: Suppose myCar is the name of a class variable that references an object, and go is the name…
Q: true of false: a) The first step in any programming task is to start coding. b) The only places we…
A: a) The first step in any programming task is to start coding. This statement is false because the…
Q: Part-2: In your main class write the following methods: 1. A method named reverse that takes an…
A: Part1: define i1, i2 in main function. For simplicity, I have taken array of i1, i2. Part2:…
Q: The program must include two classesclGradesGraph and GradesGrapghDemo. GradesGraphDemo (one…
A: your answer is given below:
Q: *6.7 (Financial application: compute the future investment value) Write a method that computes…
A: Solution :: 6.7 ) The following is the modfied program. you did not call the function…
Q: True or False: During method calls, the value of a local variable is preserved.
A: Given To know about value of a local variable is preserved or not when a method is called.
c#
uppose there is a method called Current Deposit is your project class. The method header is as below: public static decimal Current Deposit( in years , decimal future, double rate) This method will return the current amount of money in an account if you pass the future amount, the annual interest rate, and years number. Write one statement to declare a decimal variable myMoney, call the method with the future amount $50,000.00, interest rate 8%, and 15 years, and assign the returned value to myMoney.
Step by step
Solved in 2 steps
- Make sure each program has at least one method in addition to its driver method(main). Or use one driver main method and write method(s) for each of the program. Write a java program that calculate and display the GPA for a student that takes only four (4) classes. The program shall require the user to input their credit hour(s) and Letter grade for each of the classes. You may use an accumulator variable and loops. Weights based off of letter grades: A = 4, B = 3, C = 2, D=1, F = 0 GPA = Accumulator variable of (grade weight*credit hours) /total credit hours(Intro to Java) Avoid using breaks in loops or statments. Ice Cream Truck In this program, you will write a menu program for an ice cream truck. Name your program IceCream.java For this program, you will need to write 3 methods, as follows: dispayTotal Takes a double parameter for the total food price. Takes another double parameter for the percent tip calls the calculateTax method to add taxes to the price. calls the calculateTip method to add the tip to the price. Displays the price to two decimal places along with the message "With taxes and tip, your total comes to $<price>" returns nothing Note that you will need to watch the 16 videos before you can complete this method calculateTax Takes in a double parameter for the subtotal for the food. Calculates the tax, assuming the tax rate is 9.25% in San Jose adds the tax onto the the total price, returns the update price calculateTip Takes in a double parameter for the current bill (price of food + tax). Takes in…Please answer this in python. It is creating methods. Add the following four methods to your Crew class: move(self, location): This takes in a location as a string, along with self, and attempts to move the crew member to the specified location. If location is one of the five valid location options ("Bridge", "Medbay", "Engine", "Lasers", or "Sleep Pods"), then this should change self.location to that new value. Otherwise, the function should print out the message: Not a valid location. repair(self, ship): first_aid(self, ship): fire_lasers(self, ship, target_ship, target_location): The above three methods represent tasks that a basic Crew member is not capable of (but one of its derived classes will be able to accomplish). So each of them should simply print out a message of the form: <Name> doesn't know how to do that. Examples: Copy the following if __name__ == "__main__" block into your hw12.py file, and comment out tests for parts of the class you haven’t implemented…
- Stuck M9.Please answer this in python. It is creating methods. Add the following four methods to your Crew class: move(self, location): This takes in a location as a string, along with self, and attempts to move the crew member to the specified location. If location is one of the five valid location options ("Bridge", "Medbay", "Engine", "Lasers", or "Sleep Pods"), then this should change self.location to that new value. Otherwise, the function should print out the message: Not a valid location. repair(self, ship): first_aid(self, ship): fire_lasers(self, ship, target_ship, target_location): The above three methods represent tasks that a basic Crew member is not capable of (but one of its derived classes will be able to accomplish). So each of them should simply print out a message of the form: <Name> doesn't know how to do that..Herbert’s Home Repair estimates each job cost as the cost of materials plus $35 per hour while on the job, plus $12 per hour for travel time to the job site. The main() method prompts the user for the name of a job (for example, Smith bathroom remodel), the cost of materials, the number of hours of work required, and the number of hours travel time. Pass the numeric data to a method that computes an estimate for the job and returns the computed value to the main() method which displays the job name and estimated price. import java.util.Scanner; class JobPricing { public static void main(String[] args) { String description; double materials; double hoursOnJob; double hoursTraveling; double price; Scanner input = new Scanner(System.in); System.out.print("Enter job description >> "); description = input.nextLine(); System.out.print("Enter cost of materials >> "); materials =…Herbert’s Home Repair estimates each job cost as the cost of materials plus $35 per hour while on the job, plus $12 per hour for travel time to the job site. The main() method prompts the user for the name of a job (for example, Smith bathroom remodel), the cost of materials, the number of hours of work required, and the number of hours travel time. Pass the numeric data to a method that computes an estimate for the job and returns the computed value to the main() method which displays the job name and estimated price. here is my code: it is showing 2 errors (in the snapshot shown below) please help import java.util.Scanner; class JobPricing { public static void main(String[] args) { String description; double materials; double hoursOnJob; double hoursTraveling; double price; Scanner input = new Scanner(System.in); System.out.print("Enter job description >> "); description = input.nextLine();…
- Herbert’s Home Repair estimates each job cost as the cost of materials plus $35 per hour while on the job, plus $12 per hour for travel time to the job site. The main() method prompts the user for the name of a job (for example, Smith bathroom remodel), the cost of materials, the number of hours of work required, and the number of hours travel time. Pass the numeric data to a method that computes an estimate for the job and returns the computed value to the main() method which displays the job name and estimated price. An example of the program is shown below: Enter job descriptpon >> Room 210 Kitchen Enter cost of materials >> 5,000 Enter hours on the job work >> 120 Enter hours traveling >> 0 The price for Room 210 Kitchen is $9200. import java.util.Scanner; class JobPricing { public static void main(String[] args) { String description; double materials; double hoursOnJob; double hoursTraveling; double price;…Instructions This assignment must follow directions exactly. Create a class Lab02 with a main method, and put all of the following code into the main method: Print the prompt shown below and ask the user for the number of exemptions. The number of exemptions is an integer. Print the prompt shown below and ask the user for their gross salary. The gross salary represents dollars, which can be entered with or without decimal points. Print the prompt shown below and ask the user for their interest income. The interest income represents dollars, which can be entered with or without decimal points. Print the prompt shown below and ask the user for their capital gains income. The capital gains represents dollars, which can be entered with or without decimal points. Print the prompt shown below and ask the user for the amount of charitable contributions. The charitable contributions represents dollars, which can be entered with or without decimal points. Perform the calculation of…0o.Absolutely answer please Write a program that calculates the average of courses, overall grade, and letter grade. Suppose that your students take four courses - English, Mathematics, Science, and History. You should design a class that accepts all four course's numeric scores, calculates average and overall grade, and decides letter grade based on the overall grade. Your class should have a constructor, get and set methods of each course, a method that calculates the average of four courses, a method that calculates overall grade, and a method that decides letter grade. The overall grades are calculated as the following rate: Average of All four courses: 50% Quiz: 40% Attendance: 10% The letter grade is based on the following: 90.0 to 100.0 - A 80.0 to 89.9 - B 70.0 to 79.9 - C 65.0 to 69.9 - D less than 65 - F Your program demonstrates the class by asking the user to input four-course numeric scores, creating an object, and then reporting each course's score, average, overall…
- QUESTION 2 A prime number is a number that is evenly divisible only by itself and 1. For example, the number 5 is prime because it can be evenly divided only by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 1, 2, 3, and 6. Write a method named isPrime, which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Demonstrate the method in a complete program. Tip: Recall that the % operator divides one number by another, and returns the remainder of the division. In an expression such as num1 % num2, the % operator will return 0 if num1 is evenly divisible by num2. QUESTION 3 Use the isPrime method that you wrote in previous question in a program that stores a list of all the prime numbers from 1 through 100 in a file. plz answer these question using javaQUESTION 2 A prime number is a number that is evenly divisible only by itself and 1. For example, the number 5 is prime because it can be evenly divided only by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 1, 2, 3, and 6. Write a method named isPrime, which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Demonstrate the method in a complete program. Tip: Recall that the % operator divides one number by another, and returns the remainder of the division. In an expression such as num1 % num2, the % operator will return 0 if num1 is evenly divisible by num2. QUESTION 3 Use the isPrime method that you wrote in previous question in a program that stores a list of all the prime numbers from 1 through 100 in a file.use only C# programming Write a method call CubeIt(int x, ref int cube) that takes two arguments and does not return a value. The method will cube the first argument and assign it to the second argument.In your main, call this method twice and print the value of the parameters after each method call. Write a method with the following header: static void CalculateTuitionFee(int numberOfCourses, double costPerCourse, ref double fees). This method will calculate and assign the required fees amount to the third argument. [Fees = number of courses * cost per course + 15.25].From your program Main() method, call the CalculateTuitionFee () method four times supplying different arguments each time and display the value of the third argument after each method call. Write a method that takes four parameter of type int. The method will assign the sum of the first two arguments to the third and the difference of the first two to the fourth. This method should be coded so that the calling…