Java Programming (MindTap Course List)
9th Edition
ISBN: 9781337397070
Author: Joyce Farrell
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 3, Problem 8RQ
Program Description Answer
In Java the method with the declaration public static char procedure(double d) is of type “char”.
Hence, the correct answer is option “C”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Python: Use class abd pointers
2, Select the header of a method that returns the sum of the integers stored in an asTay & rrer
in C# i need to
Write a program named SortWords that includes a method named SortAndDisplayWords that accepts any number of words, sorts them in alphabetical order, and displays the sorted words separated by spaces.
Write a Main() to test this function. The SortAndDisplayWords method will be tested with one, two, five, and ten words.
my errors are
Unit Test Incomplete
Method
SortAndDisplayWords sorts and displays one words
Build Status
Build Failed
Build OutputCompilation failed: 5 error(s), 0 warnings
SortWords.cs(18,6): error CS1519: Unexpected symbol `using' in class, struct, or interface member declaration
SortWords.cs(18,14): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
SortWords.cs(19,28): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
SortWords.cs(20,14): error CS0542: `SortWords.SortWords': member names cannot be the same as their enclosing type
SortWords.cs(3,14): (Location of the…
Chapter 3 Solutions
Java Programming (MindTap Course List)
Ch. 3 - Prob. 1RQCh. 3 - Prob. 2RQCh. 3 - Prob. 3RQCh. 3 - Prob. 4RQCh. 3 - Prob. 5RQCh. 3 - Prob. 6RQCh. 3 - Prob. 7RQCh. 3 - Prob. 8RQCh. 3 - Prob. 9RQCh. 3 - Prob. 10RQ
Ch. 3 - Prob. 11RQCh. 3 - Prob. 12RQCh. 3 - Prob. 13RQCh. 3 - Prob. 14RQCh. 3 - Prob. 15RQCh. 3 - Prob. 16RQCh. 3 - Prob. 17RQCh. 3 - Prob. 18RQCh. 3 - Prob. 19RQCh. 3 - Prob. 20RQCh. 3 - Prob. 1PECh. 3 - Prob. 2PECh. 3 - Prob. 3PECh. 3 - Prob. 4PECh. 3 - Prob. 5PECh. 3 - Prob. 6PECh. 3 - Prob. 7PECh. 3 - Prob. 8PECh. 3 - Prob. 9PECh. 3 - Prob. 10PECh. 3 - Prob. 11PECh. 3 - Prob. 12PECh. 3 - Prob. 13PECh. 3 - Prob. 1GZCh. 3 - Prob. 2GZCh. 3 - Prob. 1CP
Knowledge Booster
Similar questions
- Use Java programming language Write a program that asks the user to enter 5 test grades (use an array to store them). Output the grades entered, the lowest and highest grade, the average grade, how many grades are above the average and how many are below and the letter grade for the average grade. Create a method that returns the lowest grade. Create a method that returns the highest grade. Create a method that returns the average grade. Create a method that returns how many grades were above the average. Create a method that returns how many grades were below the average. Create a method that returns the letter grade of the average (90-100 – A, 80-89 – B, 70-79 – C, < 70 – F)arrow_forwardThis program uses Java. You will be making a general class that will be called “GeneralBusiness”. This class must have the following methods: selectSalesTax() – This method will read in a file “stateTaxInfo.txt” that has the name of a state and the tax percentage (decimal form) for that state and save them to the given arrays. It will then print a menu for the user to choose the state that the business is in and set the variables to hold the values. getCustomerName() – This method will prompt the user for the name of the person using the program calcSalesTax() – This method will be sent a subtotal and calculate the sales tax outputReceipt() – This method will output a generic receipt as follows: Subtotal $37.50 Sales Tax $2.44 Total $39.94 outputMenu() - This method will receive the number of items and output a generic menu as follows: Item 1 Item 2 Item 3 Item 4 must have the following variables: stateNames - array saleTax – array saleTaxAmount theStateName subtotal total firstName…arrow_forwardMONTY HALL LAB write this code in python and use # to answers questions - You are only allowed to use the following functions/methods: print(), range(), len(), sum(), max(), min(), and .append(). It is not mandatory to useall of these functions/methods. In this lab, you will write a code that simulates the Monty Hall Game Show. Thegame host gives the participant the choice of selecting one of three doors. Twodoors has a goat behind them and one door has a prize. The set of choices arerandomized each round. The participant needs to select the door with the prizebehind it. When the participant selects a door, the game host reveals a door with agoat behind it. The game host opens a door (different from the one selected by theparticipant) that has a goat behind it. The participant is then given the option tochange their choice. When you run your code, the code would display a message prompting the user toinput their door choice, labelled as 1, 2, and 3. Then the code will display a…arrow_forward
- ANSWER MUST BE IN PYTHON3. This is the method header: #!/bin/python3 import math import os import random import re import sys # # Complete the 'linear_interpolate' function below. # # The function is expected to return a float. # The function accepts following parameters: # 1. int n # 2. List[float] x_knots # 3. List[float] y_knots # 4. float x_input # def linear_interpolate(n, x_knots, y_knots, x_input):arrow_forwardcalcProduct is a value-returning method that calculates the product of two integer values sent to the function. Which statement represents a correct way of calling this method? O a. value = calcProduct (numl, num2); O b. calcProduct (numl, num2); O c. calcProduct (int num1, int num2); O d. value = calcProduct (int num1, int num2):arrow_forwardTrue or False? Arrays cannot be passed as parameters, but must be used only in the main method.arrow_forward
- In C# In Chapter 7, you modified the GreenvilleRevenue program to include a number of methods. Now, using your code from Chapter 7 Case Study 1, modify your program so every data entry statement uses a TryParse() method to ensure that each piece of data is the correct type. Any invalid user entries should generate an appropriate message that contains the word Invalid, and the user should be required to reenter the data. An example of the program is shown below: Enter number of contestants last year >> 1 Enter number of contestants this year >> 2 Last year's competition had 1 contestants, and this year's has 2 contestants Revenue expected this year is $50.00 The competition is bigger than ever! Enter contestant name >> Matt Talent codes are: S Singing D Dancing M Musical instrument O Other Enter talent code >> Sarah Invalid format - entry must be a single character That is not a valid code Enter talent code >> R That is not a valid code Enter talent code…arrow_forwardNeed help with 11 and 12 if possible. Java Code.arrow_forwardIn C#, Write a program named Averages that includes a method named Average that accepts any number of numeric parameters, displays them, and displays their average. Test your function in your Main(). Tests will be run against Average() to determine that it works correctly when passed one, two, or three numbers, or an array of numbers.arrow_forward
- Create a C# statement that uses each of the following built-in methods you have used in previous chapters, then make an intelligent guess about the return type and parameter list for the method used in each statement you created. a. Console.WriteLine() b. String. Equals() c. String. Compare() d. Convert.Tolnt32 () e. Convert. Tochar() f. Array. Sort()arrow_forwardIn C# Define 4 methods with the names of addition, subtraction, multiplication and division. In writing methodsThe following points will be taken into consideration. The addition method takes two parameters, one is string and the other is int, anddisplays the result in the message box. This method is used in a namespace called Mathematical Operations.takes place. It takes two string methods into the subtraction method and calculates the result of the back removal operation.returns. This method can be used by creating the object of the class in the class called Operations.Multiplication calculates the multiplication of the number 5 by the number 6 and displays the result in the message box.This method is located in the name space called Carpals. No object is created from the class for use. It takes 5 parameters into the division operation, and each parameter is string, int, double, respectively.string must be int. This method divides each of these parameters in turn and calculates…arrow_forwardWhen passing any of the following data types to a function that doesn’t need to change the parameter, which method (call by reference/call by value) will you use and why? A float variable An array of integers A string A structurearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT