Requests two double values from the user and stores them in local variables in main() - Create a method which takes these two values as parameters - The method will use Math library functions to: o Print the square root of the 1st parameter o Print the log of the 2nd parameter o Print the value of the 1st parameter raised to the power of the 2nd parameter
Q: Write a Java program that will call a method (called f) to tabulate the following function. f(x) =…
A: Program to call a function to calculate the value of the function
Q: 2. Write a C# application that asks the user to input the required data to implement the three…
A: Your C# program is given below as you required with an output.
Q: Write a method dominant that accepts three integers as parameters and returns true if any one of the…
A: We need to write dominant method that accepts three integers as parameters and returns true if any…
Q: void change( int a[]) , the compiler converts the parameter to: Select one: a. int *const a b. int…
A: The compiler changes void change(int a[]) silently to void change(int *const a) at the time of…
Q: In this challenge, you need to implement a method which squares passing variables and return their…
A: Algorithm for the function squareSum Given input = num1,num2,num3 as three input numbers 0.Start…
Q: Consider the following code snippet [Pseudocode]: Method func) { PRINT "This is not an main…
A: Answer 1. The code will show compile time error. Answer 2. The code will show compile time error.
Q: Write a Java program that calls a method from main and passes it two integer parameters called…
A: The answer to the following question:-
Q: Define a method in JAVA that should take 4 numbers as the parameters and returns the average of all…
A: import java.util.* class main { public static double average(double a, double b, double c,…
Q: Writing Methods that Require a Single Parameter in Java In this lab, you complete a partially…
A: Algorithm: Start Implement a method sums() which takes a number n as argument and prints sum of…
Q: Write a program that will display the prime numbers in a given range. The program should allow users…
A: I have given an answer in step 2.
Q: Write java program that generate two integer random numbers between 15 and 43 and print out the…
A: Given question has asked to write a program having following functions: Random number generator.…
Q: java program Add a divide method to the following program to take another Fraction as the parameter…
A: Java is a high level programming language. And also object oriented . It Is a platform for…
Q: Part One: Create a method which takes two int parameters and swaps them. Print the values before and…
A: All the three methods are implemented in same program as follows
Q: write a php code which find Assignment Operator ( = )o Unary Operators ( ++, -- ,! ) Arithmetic…
A: Note: Comments mentioned in code. Code: <?php $file = fopen("D:\JAVA\comments.java", "r"); //…
Q: Your own class Add variables to the class - example a=3, b=7, x =0, y=23 a method within the class…
A: Code :
Q: Creating a JAVA program that should implement a method that verifies whether a given 4 x 4 square…
A: The codes are given in step 2.
Q: (14) static void Main() static void Main () uint A, B, C; uint A, B, C; A = 3; C = Method1 (A,B);…
A: (13) public static void Main() { uint A,B,C; A=3; B=4; C=Method1(A,B); Console.WriteLine("{0}…
Q: Given a method named factorial that takes an integer as an argument and returns a long result, call…
A: Java program to solve the given problem is below.
Q: Solve in PHP Programming Create a function that converts words or phrases depending on the value of…
A: Coded using PHP.
Q: Question:Write the method in java for following a)Method returns a translated point b) Method…
A: a. Java Translated point I Know there is this method; pt.translate(int x, int y); But is there this…
Q: Asap. 4. Define a method in JAVA that should take 4 numbers as the parameters and returns the…
A: Given: Define a method in JAVA that should take 4 numbers as the parameters and returns the average…
Q: Code in C# (OOP Concept) Do a program that does the following: Ask for a number from the user in…
A: Step 1:- The first program in the C# programming language and the second program in the C++…
Q: In this java program please explain everyline of this code. Source Code: // Online Java Compiler…
A: The above java program is to find 1. Total iterations made 2. Sum of all iterations Initially, we…
Q: Write a method that uses a loop to figure out the factorial (n!). The method will take an integer n…
A: Program Approach: 1- The main purpose of recursive is a method to call itself again n again. 2-…
Q: Using the class "c1" given below write a COMPLETE CODE for the two methods "sum" and "multiply"…
A: The objective of the program is to write two methods called multiply and max. float multiply(int ):…
Q: Complete the convert() method that casts the parameter from a double to an integer and returns the…
A: Algorithm: Start Implement convert() method which takes a double number as argument and returns an…
Q: list the arguments for the above call list the return type of sum here ______________
A: 1 public static int sum(int x, int y){ 2 int z = x +y; 3 return z; 4 } 5 public…
Q: Create a java program that does the ff: Give a definition of a class named Arithmetic whose methods…
A: PROGRAM CODE: public class Arithmetic // start the definition of the class…
Q: Need help with following Java method: import java.util.Scanner; import java.lang.Math; public class…
A: The program uses the Scanner package which is used for taking user inputs during run time. The next…
Q: 1. Write a program in Java that should do the following: a. Prompt the user to enter 3 grades…
A: logic:- multiply any of integer by 1.0 so that average method returns double value . read a, b…
Q: Write java program that generate two integer random numbers between 15 and 43 and print out the…
A: import java.util.Random;public class Main{ public static void main(String[] args) { //calling…
Q: Write a Java program with the main method and a multiplication method (must be created, not the…
A: The matrix multiplication is each and every element is sum of product of values in same row in first…
Q: Java RMI modify “MyClient.java”, “Method.java” and “MethodRemote.java” After your modification,…
A: Use the following files!
Q: To write an application that uses recursion to solve a problem. Details: Create a class called Power…
A: Given: To write an application that uses recursion to solve a problem. Details: Create a class…
Q: use java Declare a method and complete the following operations. a. Method name is Add b. It…
A: Find Your Answer Below
Q: Create Java Program that ask the user to insert array length and then ask the user to insert array…
A: Algorithm : findAverage function : Step 1 : declare and initialize variables. Step 2 : use for…
Q: basic java please Write a method called findTip that finds the value of a meal as a double…
A: In this code, a function named findTip is called in the main function and the tip is added to the…
Q: Many computations can be expressed more concisely using the multadd operation, which takes three…
A: public class Multadd { public static double multadd(double a, double b, double c){ return…
Q: The following program generates an error. Why? public static void printSum(int num1, int num2) {…
A: main is void so, it can not return any value hence, return 0 should not be there. printsum() is…
Q: A pedometer treats walking 1 step as walking 2.5 feet. Define a method named feetToSteps that takes…
A: - We need to highlight the code for the provided scenario.
Q: Write a program that implements iterator class called Prime and which prints prime numbers up to n.…
A: Python Program: def prime_number(n): for d in range(2, int(n ** 0.5) + 1): if n % d == 0:…
Q: type of expansion nonne ative powers of the variable. The Maclaurin series expansion for sin(x) is…
A: Algorithm: Start Read angle x and no.of terms n Convert angle in degrees to radians…
Q: java programming: pleas see attachment as well***** In this task, you are asked to write a…
A: Note: Comments mentioned in the code for understandability. Code: import java.util.*; class swap {…
Q: It is possible to invoke a method without explicitly providing an argument into a parameter when…
A: Given that: It is possible to invoke a method without explicitly providing an argument into a…
Language:Java
- Requests two double values from the user and stores them in local variables in main() - Create a method which takes these two values as parameters
- The method will use Math library functions to:
o Print the square root of the 1st parameter
o Print the log of the 2nd parameter
o Print the value of the 1st parameter raised to the power of the 2nd parameter
Step by step
Solved in 2 steps with 1 images
- NOTE: JAVA language Write a program that asks the user for his first name and then prints it using a function/method called printName(). We do not expect the first name to exceed 20 letters. Then the program should print the name with a space between each character. Example: if the first name is Maryam, the :program will print Maryam -1 Maryam -2Code in C# (OOP Concept) Do a program that does the following: Ask for a number from the user in the main method o Pass thenumber to a method call it "Multiplication”. In the Method Multiplication, multiply the number by a number enteredby the user (mention that the number should be positive). Send the result back to the main and print it from the mainModify the previous program if the user enters a negative second number in the method Multiplication, do not acceptthe number and ask the user to reenter it again. . Add another method call it also Multiplication Ask for a float numberfrom the main and send it to the new Multiplication. This method should also ask for another positive number fromthe user and multiply it by the float number. Design and implement a function called "multiply" in C++ that accepttwo numbers and returns either the arithmetic multiplication or repetition of a given string a specific number of timesdepending on the data types of the argument values. The…Computer Science Write a Java program that calls a method from main and passes it two integer parameters called minValue and maxValue. The method should prompt the user to enter a number within the range of minValue and maxValue (inclusive), until the user provides a valid input. The method should return the value provided by the user, and the program should display what the user entered after the method is called.
- JAVA Problem description:You are to write a program called Seasons that prompts the user for a month and day and displays the season in which that date occurs. For reference, we will use the following date cutoffs for the various seasons: Winter December 21 – March 19 Spring March 20th – June 20th Summer June 21st – September 20th Fall September 21st – December 20th Data Validation For this program, you'll write a specific method to perform data validation based on the month and day entered. More specifically: Month – the month entered must be a valid month of the year (January – December). Day – the day entered must be a valid day for that month: January, March, May, July, August, October, December have 1-31 days. April, June, September, November have 1-30 days. February has 1-28 days (do not worry about leap years) Required program decomposition String getMonth(Scanner console) This method is called from the main method and should prompt for the month as a string…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…basic java please Write a void method named emptyBox()that accepts two parameters: the first parameter should be the height of a box to be drawn, and the second parameter will be the width. The method should then draw an empty box of the correct size. For example, the call emptyBox(8, 5) should produce the following output: ***** * * * * * * * * * * * * ***** The width of the box is 5. The middle lines have 3 spaces in the middle. The height of the box is 8. The middle columns have 6 spaces
- c# Now, modify the program so that the major functions appear in the following individual methods: GetMonth - This method prompts for and returns the month GetNumMurals - This method prompts for and returns the number of murals scheduled and is called twice -- once for interior murals and once for exterior murals ComputeRevenue - This method accepts the number of interior and exterior murals scheduled, accepts the month they are scheduled, displays the interior and exterior prices, and then returns the total expected revenue DataEntry - This method fills an array with customer names and mural codes and is called twice -- once to fill the array of interior murals and once to fill the array of exterior murals GetSelectedMurals - This method continuously prompts for mural codes and displays jobs of the corresponding type until a sentinel value is entered using systeml using static System.Console; using System.Globalization; class MarshallsRevenue { staticvoidMain() { // Your code here…Financial Application:• Write a program that computes future investment value at a given interest rate for aspecified number of months and prints the report shown in the sample output. • Given the annual interest rate, the interest amount earned each month is computedusing the formula: Interest earned = investment amount * annual interest rate /1200 (=months * 100) • Write a method, computeFutureValue, which receives the investment amount, annualinterest rate and number of months as parameters and does the following: o Prints the interest amount earned each month and the new value of theinvestment (hint: use a loop). o Returns the total interest amount earned after the number of months specified bythe user. The main method will:o Ask the user for all input needed to call the computeFutureValue method.o Call computeFutureValueo Print the total interest amount earned by the investment at the end of thenumber of months entered by the user. Sample Program runningEnter the investment…In Java code do the following:Write a method that accepts a String as an argument. The method should use recursion to display each individual character in the String:
- basic java please Write a method dominant that accepts three integers as parameters and returns true if any one of the three integers is larger than the sum of the other two integers, otherwise it returns false. The integers might be passed in any order, so the largest value could be any of the three. If no value is larger than the sum of the other two, your method should return false. For example, the call of dominant(4, 9, 2) would return true because 9 is larger than 4 + 2. The call of dominant(5, 3, 7) would return false because none of those three numbers is larger than the sum of the others.Using METHOD SAMPLE Problem: Create a method that will compute the value of PI, if pi is 3.14. Given formula is : value = pi x square of radius Solution: float area(int radius) final float pi = 3.14f; float val; val = pi * (float) (radius * radius); return(val); Direction: Analyze the given problem and create a java method. Problem: Create a method that will compute the Mass (m). Acceleration(a) is 9.80. if Force (F) is equal to acceleration multiplied by mass.C# n Chapter 6, you continued to modify the GreenvilleRevenue program. Now, modify the program so that the major functions appear in the following individual methods: GetContestantNumber - This method gets and returns a valid number of contestants and is called twice once for last year’s number of contestants and once for this year’s value DisplayRelationship - This method accepts the number of contestants this year and last year and displays one of the three messages that describes the relationship between the two contestant values GetContestantData - This method fills the array of competitors and their talent codes GetLists - This method continuously prompts for talent codes and displays contestants with the corresponding talent until a sentinel value is entered An example of the program is shown below: Enter number of contestants last year >> 2 Enter number of contestants this year >> 3 Last year's competition had 2 contestants, and this year's has 3 contestants…