Write a program that prompts for a full name (first and last) and assigns it to one string. The program then passes the full name to a void method as its sole parameter. The void method should print the first name, on one line, as many times as indicated by the length of the last name. Sample Output Enter your full name Helen Hywatter Helen Helen Helen Helen Helen Helen Helen Helen
Q: Write a method1 that returns whether a given positive integer has at least one odd digit whose value…
A: Programming instructions: Create a class. Create a function which takes a number in the argument.…
Q: Write a static method isValidPassword() that checks whether a string is a valid password. The method…
A: I have given an answer in step 2.
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: a) Write a boolean method called sumDivisibleByFive that returns true if the sum of the digits of…
A: Both questions are solved in one problem and programming language are not mentioned in the problem…
Q: Write a program that simulates tossing a coin. Prompt the user for how many times to toss the coin.…
A: Program code://import the required header filesimport java.util.*;//define a class Tossclass…
Q: Write a method (with a parameter n) , n: integer type that prints numbers from 1 to n. • The print…
A: Given: Solution code in java this code run all java platform.
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: Write a static method called "acronym" that takes as a parameter a String containing a phrase and…
A: The main objective of the java program, Acronym.java is to demonstrate the method, acronym. The…
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: 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 program that prompts the user to enter the numberof students and each student’s name and…
A: Program code: //Import necessary header files import java.util.*; //Declare the class name public…
Q: For what value of the parameter į would the return of this method be 8 given that value of j =1? If…
A: For i = 2 and j = 1, the return of the given method will be 8.
Q: Create a program that + has a method called isPositive() which takes one double parameter and…
A: Sample Response: //Java program to check whether an input number is positive or notimport…
Q: Write a method that returns a person's full name given their first and last names as Strings. The…
A: Given : first and last names as string output : lastName, firstName
Q: Write a program called volumeCalculator, and copy the following code into it. public static void…
A: public static double prismVolume(double l, double w, double h) { double ba = l * w; double v =…
Q: A programmer wants to create a method that is called addThreeNums. The method receives three…
A: - We need to choose the correct function definition among the given for the addition of three…
Q: Given the following method; public static void mystery(int x) { int z = 10; if (Z <= x) Z--; z++;…
A: The correct answer is given below with full code and explanation
Q: Write a program, named UpdatedNumbers with the following method: Write a method to
A: Since programming language not mentioned using Java language
Q: A programmer wants to create a method that is called yesNo. The method receives a String and an…
A: The correct answer is given below with explanation
Q: Given main(), complete the Car class (in file Car.java) with methods to set and ge t the purchase…
A: Required java code provide below:
Q: Write a method named printTemperature of type void to display a table of the Celsius temperatures O…
A: C code #include <stdio.h> void printTemperature(int cel[],int size) { double far[size];…
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 program that prompts for a full name (first and last) and assigns it to one string. The…
A: Here first we need to calculate the total number of character in firstName and total number of…
Q: Write a program that will prompt the user to enter a sentence (string data), read that entire…
A: I give the code in Java along with code and output screenshot
Q: Write a method with the following header to display threenumbers in decreasing order:public static…
A: Since you are not mentioning the programming language, here we are using Java to complete the…
Q: Given the code below, what will be the value returned from the method invocation shown? public…
A: 15
Q: Write a program that contains 2 methods, main and printLine 1) The printLine method will do the…
A: Program plan: Import necessary packages.Define a class named “PrintCheck”.Define a method called…
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: What is the return type of the method below? public static Omlette makeSomeBreakfast(Eggs huevos,…
A: What is the return type of the method below? public static Omlette makeSomeBreakfast (Eggs huevos,…
Q: Write a program that contains 2 methods, main and printLine (10 points)1) The printLine method will…
A: Declare required variables ‘first’, ‘second’ and ‘times’ which is used to store first character,…
Q: What value is returned from the following method? public static double methodA() { double a…
A: //Define the method public static double methodA() { //Declare and initialize the variable…
Q: Write a method call DisplaySineTable(), that prompts the user for a starting value and an step size.…
A:
Q: What is printed by the following code segment? doThus(3, 1); Given the method definitions: public…
A: Given code is as follows:- public class Testing { public static int doThat(int x, int y) {…
Q: Write a program that displays the income tax due on taxable income entered by the user. Have the…
A: The program that displays the income tax due on taxable income is created in java.In calTax() method…
Q: 5) Write a method which gets a value from the user and convert that value from Celsius to…
A: Start declare celsius , fahrenheit Input temperature in celsius fahrenheit = (9*celsius/5)+32…
Q: a) Write a boolean method called sumDivisibleByFive that returns true if the sum of the digits of…
A: Algorithm: Start Implement a method named sumDivisibleByFive() which takes a number n as argument…
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: 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: Consider the following method: public static void method (int x, int y) { if (x < y) { method (x+1,…
A: The given is a Java function that recursively calls itself. The function method takes 2 integer…
Q: • Write a method (with a parameter n) , n: integer type that prints numbers from 1 to n. • The print…
A: Given:
Q: public static double methodXY() { double a = 6.5 + 8.5; if( a > 12) return a;…
A: Answer is 15.0
Q: Write a program that has a loop of three iterations. In every iteration, the program should prompt…
A: ## AS no language mentioned, we write the code in Python language. # user define function to…
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: Write a program that passes an unspecified number of integers as command-line arguments to the main…
A: public class Lab9{ public static void main(String[] args) { //command line arguments are args…
Q: Given the code below, what will be the value returned from the method invocation shown? public…
A: mystery(8,7)-> 7+mystery(4,14) -> 7+14+mystery(2,28)…
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: Consider the method below: public void myMethod() { 01 02 03 int x = 3; 84 printin(x + y); int z =…
A: The lines where it is valid to access the value of y:
Q: Program62.java Write a program that prompts for a full name (first and last) and assigns it to one…
A: As per guidelines we are supposed to answer only one question. Kindly repost other questions as…
Q: A store owner keeps a record of daily cash transactions in a text file. Each line contains three…
A: Given
I need help with these questions.
As per our company guidelines we are not supposed to answer more than one question per post and kindly resubmit the remaining questions in another post
Step by step
Solved in 3 steps with 1 images
- Java Your program will read in a credit card number and expiration date from the user and validate the data. The program will continue to ask for user input until a valid number and date are entered. The rules for what is valid are specified below. readYear() and readMonth(int) methods Complete the readYear() and readMonth(int) methods. These methods ask the user to input the expiration year and month of their credit card. Each method should contain a loop inside the method so the code repeats until a valid month or year is entered by the user. If the user enters an invalid year or month, print an error message and ask them to try again. The readMonth(int) method reads in the month as a number. A valid month is any number between 1 and 12 (inclusive). A valid year is 2022 or later. readCreditCardNumber() method Complete the readCreditCardNumber() method. This method asks the user to input their credit card number. This method should contain a loop so the code repeats until a valid…Write a program that reads a student’s name together with his or her test scores. The program should thencompute the average test score for each student and assign the appropriate grade. The grade scale is asfollows:90-100, A; 80-89, B; 70-79, C; 60-69, D; 0-59, FYour program must use the following methods:(a) A value-returning method, calculateAverage, to determine and return the average of fivetest scores for each student. Use a loop to read and sum the five test scores. (This method doesnot output the average test score. That task must be done in the method main.)(b) A value-returning method, calculateGrade, to determine and return each student’sgrade. (This method does not output the grade. That task must be done in the method main.)Test your program on the following data. Read the data from a file and send the output to a file. Do notuse any global variables. Use the appropriate parameters to pass values in and out of methods.Johnson 85 83 77 91 76Aniston 80 90 95 93 48Cooper 78…1. Write the following method that returns the intersecting point between two lines (p1, p2) and (p3, p4): public static Point 2D getIntersecting Point ( Point 2D pl, Point 2D p2, Point 2D p3, Point2D p4); The method returns null if the two lines are parallel. Write a test program that prompts the user to enter three points and displays the center point. Here is a sample run. (Hint: for finding the intersecting point between two lines, see Programming Exercise 8.31.) Enter x1, yl, x2, y2, x3, y3, x4, y4: 225 -1.0 4.0 2.0 -1.0 -2.0 The intersecting point is at (2.88889, 1.1111) The two lines are parallel1. Write a program that takes three numbers (a,b,c) from the user as input and finds the median of the three. The program has a method called median that takes 3 numbers as the parameter and returns the median. Use if-then-else statements to find the median. You can assume the three numbers are not the same. Sample Example: Enter 3 numbers 10 13 The median is 10 public class Median{ public static void main(String[] args){ Scanner input = new int a = int b = int c =1. Write the following method that returns the intersecting point between two lines (p1, p2) and (p3, p4): public static Point2D getIntersecting Point ( Point 2D pl, Point2D p2, Point 2D p3, Point2D p4); The method returns null if the two lines are parallel. Write a test program that prompts the user to enter three points and displays the center point. Here is a sample run. (Hint: for finding the intersecting point between two lines, see Programming Exercise 8.31.) Enter x1, yl, x2, y2, x3, y3, x4, y4: 2 2 5 -1.0 4.0 2.0 -1.0 -2.0 The intersecting point is at (2.88889, 1.1111) Enter x1, yl, x2, y2, x3, y3, x4, y4: 2 2 7 6.0 4.0 2.0 -1.0 -2.0 The two lines are parallelWrite a program that contains 2 methods, main and printLine (10 points) 1) The printLine method will do the following: a. receives 3 parameters: the first character, the second character and the number of times to print the characters. b. using a loop, the program prints a line of text consisting of the first character concatenated with the second character repeated the number of times entered by the user. 2) The main method will do the following: a. asks the user for a character. b. using a Scanner gets the character C. asks the user for a second character. d. using a Scanner gets the second character e. asks the user how many times to print f. using a Scanner gets the number of times to print g. calls the method printLine. Sample Run: Enter a character ? Enter a second character Enter the number of times to repeat 5 ?*?*?*?"?* Enter a character ! Enter a second character @ Enter the number of times to repeat 8 !@!@!@!@!@!@!@!@ Submission • Copy and paste your code • Screen shot the…basic java please Write a method called findTip that finds the value of a meal as a double after adding the tip to the cost. Then return this value to the calling function. For example findTip(120.10, 5) would 126.105 because that is a 5% tip. While findTip(48.0, 15) would return 55.2 because that is a 15% tip. Note that the bill is a double while the tip is an int. Don’t worry about rounding to two decimal places, just return the full value as a double.Write a program that contains 2 methods, main and printLine (10 points)1) The printLine method will do the following:a. receives 3 parameters: the first character, the second character and thenumber of times to print the characters.b. using a loop, the program prints a line of text consisting of the first characterconcatenated with the second character repeated the number of timesentered by the user. 2) The main method will do the following:a. asks the user for a character.b. using a Scanner gets the characterc. asks the user for a second character.d. using a Scanner gets the second charactere. asks the user how many times to printf. using a Scanner gets the number of times to printg. calls the method printLine. Sample Run:Enter a character?Enter a second character*Enter the number of times to repeat5?*?*?*?*?*Enter a character!Enter a second character@Enter the number of times to repeat8!@!@!@!@!@!@!@!@ Submission• Copy and paste your code• Screen shot the console with ANY TWO Sample…Write a program that displays the income tax due on taxable income entered by the user. Have the user enter the tax in the main() method, and then call a calcTax() method to compute the tax. Print the value returned. The calcTax() method should have one parameter - income - and return a double - tax. The tax is calculated as follows: Income Tax Due $0 - $50,000 5% $50,000-$100,000 $2,500 + 10% of (income > $50,000) > $100,000 $7,500 + 15% of (income > $100,000)Task 03: Read the concept of Binomial coefficient given in chapter-6. Write a method that takes two parameters n and k and returns the value of Binomial Coefficient C(n, k). For example, your function should return 20 for n = 6 and k = 3, and it should return 35 for n= 7 and k = 4. ( confirm it through the Pascal's triangle as given below). 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 15 10 10 5 1 15 (20) 15 6 1 1 7 21 35 (35 21 7 1 1Question 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 75in java pls: You have been asked to produce a report for a hardware store The name for each item is widget with the word designating the number of the widget. There are ten widgets in all. Your program will ask the user for the range of the cost for items, range of the price of the items in doubles. The range for the quantity in stock will be between 0 and 9999 as an int. Your program will randomly generate the cost of the items, price of the items the number in stock for this sample report based upon the ranges entered. Make sure the price of the item is greater than the cost. Profit is calculated as (price- cost) * in stock. Any time quantity falls below 25 the reorder column will display Yes, otherwise it will display No. Your chart will generate data for ten items and the chart will look like the one below. Part QuantityName Cost Price in Stock…SEE MORE QUESTIONS