Write the definition of a void method

Assignment Help JAVA Programming
Reference no: EM131129971

Q1: Write the definition of a void method that takes as input two parameters of type int, say sum and testScore. The method updates the value of sum by adding the value of testScore. The new value of sum is sent back to the caller statement.

Q2: Write a method, is Vowel, which returns the value true if a given character is a vowel and otherwise returns false.

Q3: Write the definition of a void method that inputs an integer number and output the result as 3 times the value of that number.

Q4: Find the sum of the following series using methods:

(a) 1+1/2+1/3+1/4+1/5

(b) 1-2+5-10+17-26

Q5. Write the definition of a method that takes as input a char value and returns true if the character is uppercase, otherwise, it returns false.

Q6. Create a class that mimics a Bank account. It should have functions to get the account balance, withdraw money, should not allow for overdraft i.e., should check that minimum balance is zero. It should show the account holders name, bank and account details. The main() function should be used to display and check all functions.

Q7. Create a program to mimic a petrol vending machine. It should be able to sell petrol and diesel at Rs 65 per litre and Rs 45 per litre. The program should take as input the total amount of petrol/diesel to be sold and produce a bill with 12% Vat and 6% sales tax.

Q8. Create a program that takes marks in five subjects English, Hindi, Maths, Science, Social Studies as input. It calculates grades and displays it as follows:

  • Marks >= 90 = Grade A+
  • Marks >= 75 = Grade A
  • Marks >= 60 = Grade B
  • Marks >= 50 = Grade C
  • Marks >= 40 = Grade D
  • Marks <40 = Grade D

If the overall marks are less than 200 or grades in 2 or more subjects is F. then the child is held back else he is promoted.

Q9. Write a program in lava to accept two numbers and check whether they are twin prime or not by using the function name prime (). The function returns 1 if the number is prime otherwise returns 0.

Twin Prime numbers are such prime numbers whose difference is 2, (11, 31), (17, 19)........ are the example of twin prime numbers.

Reference no: EM131129971

Questions Cloud

Aspects of the fasb conceptual framework : Determine whether the following statements are true or false. If a statement is false, explain why. 1. Comprehensive income includes changes in equity resulting from distributions to owners.
Create an application that contains an enumeration : Create an application that contains an enumeration (enum) that represents the days of the week.  Display a list of the days, and then prompt the user for a day
How might reports empower an organization : Provide responses to the following questions, based on your readings and class discussions, in 100-200 words each. Describe the difference between internal and external reports. What functions might an organization's internal reports serve? What fun..
What is the maximum inventory achieved during production run : A shop that makes candles offers a scented candle, which has a monthly demand of 360 boxes. Candles can be produced at a rate of 36 boxes per day. The shop operates 20 days a month. What is the annual demand? What is the maximum inventory achieved du..
Write the definition of a void method : Write the definition of a void method that takes as input two parameters of type int, say sum and testScore. The method updates the value of sum by adding the value of testScore. The new value of sum is sent back to the caller statement
The information technology outsourcing business : What recommendation would you give to the Brazialian government and it's outsourcing industry in order to improve their prospects for success in building a strong international competetive position in the information technology outsourcing business?
When it comes to permission marketing : When it comes to permission marketing, do you think that people take the time to unsubscribe or do you think it's easier to just delete the emails if they don't interest you? How does just deleting that emails skew marketing data that the company is ..
Social and cultural issues leaders in health care face : Find an article on a current event that deals with the social and cultural issues leaders in health care face. Write a 1,750- to 2,100-word analysis of ethics and ethical responsibilities in health care. What is the issue? How was it handled? What wa..
Corporate level strategy is set of actions in firm : Corporate level strategy is a set of actions in a firm takes to gain competitive edge by having different businesses competing with different products in different markets. Low diversification- this involves minimal diversification most of the revenu..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Design and implement a small and simple email server using

design and implement a small and simple email server using the concept of web based information system. your system

  Presell a limited number of cinema tickets

Write an application to presell a limited number of cinema tickets. each buyer can buy as many as 4 tickets. No more than 100 tickets can be sold. Implement a program called TicketSeller that prompts the user for the desired number of tickets and the..

  Write client code to call the print method of counter.

Write client code to deposit 7 quarters, 3 dimes, 10 nickels, and 17 pennies in counter. Output the new status of counter using the toString method.

  Program that lets the user enter four quarterly sales

The figures should be stored in a two-dimensional array. Once the figures arc entered, the program should display the following data for each quarter:

  Create pipe-and-filter network that will read data stream

Create a pipe-and-filter network that will read the data stream in FlightData.dat file, convert the temperature measurements from Fahrenheit to Celsius, and convert altitude from feet to meters - How would this impact the key quality attributes of ..

  Write a recursive method to reverse a string.

write a recursive method to reverse a string. Explain why you would not normally use recursion to solve this problem?

  Create a new child class and new driver program

In this assignment you will create a new child class and new driver program. Please review that example before continuing with this assignment. You should fully understand the shape program above

  Write a method reversefirstk

Write a method reverseFirstK that accepts an integer k and a queue of integers as parameters and reverses the order of the first k elements of the queue, leaving the other elements in the same relative order.

  Java program on eclipse

Using a while( true ) loop,and using the upper case alphabeth from Z to A,print the lower case alphabeth and its corresponding ascii values.You must terminate/exit/break this loop once you process the last letter (A).

  Implement a distributed banking application

In the first part, you will implement a distributed banking application. The distributed bank has multiple branches. Every branch knows about all other branches.

  Create a class named purchase

Create a class named Purchase. Each purchase contains an invoice number, amount of sale, and amount of sales tax. Include set methods for the invoice number and sale amount.

  Using an array in java

Using an array in Java - have a list of keywords from a web service and have to print out the list of keywords on the screen with one keyword on each line. This is my code

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd