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

  Each purchase contains an invoice number amount of sale

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.

  Prompts the user to enter 4 numbers for a salesperson

Write a program (SalespersonCommission.java) that prompts the user to enter 4 numbers for a salesperson's items sold for last week and displays that salesperson's earnings.

  Develop a mobile game using any game scenario of your choice

Using the J2ME platform, develop a mobile game using any game scenario of your choice. You are required to provide the following features in your implementation: 2D implementation using sprite, game canvas and tiled layer

  Java program to create a tree

Java program to create a tree, generate class - BottomUpTwoThreeFourTree, BottomUpTwoThreeFourTree,

  Prepare a method that takes a string as input

Prepare a method that takes a String as input and returns a String containing the middle character of the String if the length of that String is odd.

  I had to call a webservice

I had to call a webservice (1st line of code) and then from there created a loop but keep getting an error every time on the .getBusiness - I don't know what I should be using there instead of getBusiness.

  Accepts a binary number from the user

Write a Java test program that accepts a binary number from the user. You should store the binary number in a String. Your program should then use afor loop to sequence through every character in the String, counting the number of ones, zeros, and..

  Delete a random element from an arraylist

Elements in an ArrayList and picking one at random to remove. Unfortunately, this slow, since deleting a random element from an ArrayList is slow because of all the shifting. For this question, you should modify the poll()method so that it runs in..

  Instantiate a circle by giving its radius and use

Write a class Circle.java from which we can instantiate a circle by giving its radius and use it as is shown in the following program. 1 import java.util.Scanner; 2 public class Circles {

  Sample papaer hello can you please help me to solve this

hello can you please help me to solve this sample paper and there is not submit date as this is for me but still i want

  How do i display a message in the browsers status bar

How do I display a message in the browser's status bar? What are the main differences between applets and applications?

  Write a jsp webpages ask the user to enter data

Write a jsp webpages ask the user to enter the following data- First name, Last name

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