plz Help me find the correct programs answers

Ads
 

plz Help me find the correct programs answers

  1. Create a washing machine class with methods as switchOn, acceptClothes, acceptDetergent, switchOff. acceptClothes accepts the noofClothes as argument & returns the noofClothes

  2. Create a calculator class which will have methods add, multiply, divide & subtract

  3. Create a class called Student which has the following methods:

i. Average: which would accept marks of 3 examinations & return whether the student has passed or failed depending on whether he has scored an average above 50 or not.

ii. Inputname: which would accept the name of the student & returns the name.

  1. Create a Bank class with methods deposit & withdraw. The deposit method would accept attributes amount & balance & returns the new balance which is the sum of amount & balance. Similarly, the withdraw method would accept the attributes amount & balance & returns the new balance ?balance ? amount? if balance > = amount or return 0 otherwise.

  2. Create an Employee class which has methods netSalary which would accept salary & tax as arguments & returns the netSalary which is tax deducted from the salary. Also it has a method grade which would accept the grade of the employee & return grade.

  3. Create Product having following attributes: Product ID, Name, Category ID and UnitPrice. Create ElectricalProduct having the following additional attributes: VoltageRange and Wattage. Add a behavior to change the Wattage and price of the electrical product. Display the updated ElectricalProduct details.

  4. Create Book having following attributes: Book ID, Title, Author and Price. Create Periodical which has the following additional attributes: Period (weekly, monthly etc...) .Add a behavior to modify the Price and the Period of the periodical. Display the updated periodical details.

  5. Create Vehicle having following attributes: Vehicle No., Model, Manufacturer and Color. Create truck which has the following additional attributes:loading capacity( 100 tons?).Add a behavior to change the color and loading capacity. Display the updated truck details.

  6. Write a program which performs to raise a number to a power and returns the value. Provide a behavior to the program so as to accept any type of numeric values and returns the results.

  7. Write a function Model-of-Category for a Tata motor dealers, which accepts category of car customer is looking for and returns the car Model available in that category. the function should accept the following categories "SUV", "SEDAN", "ECONOMY", and "MINI" which in turn returns "TATA SAFARI" , "TATA INDIGO" , "TATA INDICA" and "TATA NANO" respectively.

Plz mail me your answers at [email protected] Thanks........

View Answers

December 16, 2010 at 12:56 PM

For 3 problem

package com;

import java.io.BufferedReader; import java.io.InputStreamReader;

/** * pote * @author pradeshs */

public class Student { public static void avg(int value1,int value2,int value_3,String name) { int output=(value1+value2+value_3)/3; // calculating average value for 3 subjects System.out.println("Average:::"+output); if(output>=50) // condition for checking whether the student has passed or failed { System.out.println("PASS"); System.out.println("Name of the student:"+name); // task 2- returns name } else { System.out.println("FAIL"); System.out.println("Name of the student:"+name); // task 2- returns name } } public static void main(String[] args) { int value1, value2,value_3; // local variables BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); try { System.out.println("\t\t Average::::::::"); System.out.println("Enter the your name :"); String name =in.readLine(); // Input value from keyboard for name // taken for the second task. System.out.println("Enter the First Subject Mark :"); value_1 = Integer.parseInt(in.readLine()); // Input value from keyboard for first value System.out.println("Enter the Second Subject Mark: "); value_2 = Integer.parseInt(in.readLine()); // Input value from keyboard for second value System.out.println("Enter the Third Subject Mark: "); value_3 = Integer.parseInt(in.readLine()); // Input value from keyboard for third value avg(value1,value2,value_3,name); } catch (Exception e) { System.out.println("Error:::" + e); } } }


December 16, 2010 at 12:59 PM

For Bank Problem

package com;

import java.io.BufferedReader; import java.io.InputStreamReader;

/** * pote * @author pradeshs */ public class Bank {

static int output;                                          // variables are defined at class level

public static void deposit(int amount, int balance) // performs deposit calculation
{
    output = amount + balance;
}

public static void withdraw(int amount, int balance) // performs withdraw calculation
{
    output = balance - amount;
    if (balance >= amount) {
        System.out.println(":::Inside the WithDraw method :::");
    } else {
        System.out.println(":::Inside the WithDraw method :::");
        output = 0;
    }
}

public static void main(String[] args) {
    int amount, balance;                                        // local variables
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    try {
        System.out.println("\t\t BANK ::::::::");
        System.out.println("Enter the Amount value: ");
        amount = Integer.parseInt(in.readLine());               // Input value from keyboard for amount value
        System.out.println("Enter the Balance value: ");
        balance = Integer.parseInt(in.readLine());               // Input value from keyboard for balance value
        deposit(amount, balance);                               // deposit method called for computation
        System.out.println(":::Inside the Deposit method :::");
        System.out.println("New Balance:::" + output);
        withdraw(amount, balance);                              // withdraw method called for compu
        System.out.println("New Balance:::" + output);
    } catch (Exception e) {
        System.out.println("Error:::" + e);
    }

}

}

Ads









Related Tutorials/Questions & Answers:
plz Help me find the correct programs answers
plz Help me find the correct programs answers   Create a washing machine class with methods as switchOn, acceptClothes, acceptDetergent, switchOff... INDICA" and "TATA NANO" respectively. Plz mail me your answers
plz help me find a program
plz help me find a program  plz help..i want a source code in jsp for order processing
Advertisements
plz help me for this question
plz help me for this question  Apply simplex procedure to solve the L.P.P. maximize z = 3x1 + 4x2 subject to 5x1 + 4x2 ? 200; 3x1 + 5x2 ? 150; 5x1 + 4x2 ? 100; 8x1 + 4x2 ?? 80, x1 ? 0, x2 ? 0
Plz Help Me
Plz Help Me  Write a program for traffic light tool to manage time giving between Main-Street and sub-Street. firstly, give green light for 40... traffic light on the frame. We have used java swing. It may help you. import
plz help me - Java Beginners
plz help me  deepak hw can i create a data grid in jsp and also how can i connect to the data base plz help me  to create data grid in jsp use html tables with borders. to connect to data base use scriptlets. ex
Intranet Website creation - plz help me
Intranet Website creation - plz help me   hi.. I have assign with the intranet website creation work..right from scratch to end..And honestly I know nothing about it.My domain is totally different .. can anybody pls help me
Help me plz in Probablity distribution of Java
Help me plz in Probablity distribution of Java  Hello, I have...% is insert or update queries. Which distribution to use and how to achieve it.. Plz help thanks for your time
PLZ HELP ME. i need php code.
PLZ HELP ME. i need php code.   I want php code for bellow OUTPUT. output is just example but it must be letters only. abc bcd efg jku rgt azs hje qqc wws adt
help me plz befor 27 februry
help me plz befor 27 februry  what is rung with this ?? help me plzzzz import java.util.Scanner; public class Initials { public static void main (String [] args) { String firstname,lastname
Is the logic correct to detect IE version..plz let me know
Is the logic correct to detect IE version..plz let me know  <html> <head> <script type="text/javascript"> function...;/head> <body> <form> <input type="button" value="Click me
plz check my codings are correct or not...There is an error..i cant find it..
plz check my codings are correct or not...There is an error..i cant find it..  import java.util.Scanner; public class Student { private String indexNo; private String gender; private char initial; private int mark1
interview question plz help me and thers
interview question plz help me and thers  A college is good if it satisfies the following conditions: 1.Its number of students is greater than 1000. 2.If the name ends wih a character 'e', then it should not start with character
I didn't gat an output for this code, plz send me a correct code
I didn't gat an output for this code, plz send me a correct code  Hi, Here is my code: import java.awt.event.*; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import javax.swing.*; import java.sql.*; public
help me plz:-Merge multiple jasper files into Single one
help me plz:-Merge multiple jasper files into Single one  how to Merge multiple jasper files into Single one word doc
please help me to answers this question about C++.....huuhuhuhu
please help me to answers this question about C++.....huuhuhuhu  1) Write a full program for the bubble sort algorithm. User is required to enter specific input numbers and the program will be able to sort the given numbers
please help me to answers this question about C++.....huuhuhuhu
please help me to answers this question about C++.....huuhuhuhu  1) Write a full program for the bubble sort algorithm. User is required to enter specific input numbers and the program will be able to sort the given numbers
plz help me any one as fast as u can
plz help me any one as fast as u can  A thief Muthhooswamy planned to escape from **** jail. Muthhooswamy is basically a monkey man and he is able... is given in an array. Write a program to find out the total number of jumps he
plz give me answer plz
plz give me answer plz  writw a programme to find rank from an array using doubledimmensionalarray
population problem plz help me befor 16 March 2011 !!
population problem plz help me befor 16 March 2011 !!  the Q is : How can i count how many years it will take for the population of a town to go over 30.000 .. consider that it Increases 10% every year ?? And this is my code &
Plz Help
Plz Help  Hello Guys!! Plz. Help I need to write a program to display the astrological sign based on your birthday for example If we enter the date of birth in the following format from console--13/08/1990 it should give you
plz give me program to this: Given a string and a number ‘n’, find the ‘n’th distinct repeating character.
plz give me program to this: Given a string and a number ?n?, find the ?n?th distinct repeating character.    Given a string and a number ?n?, find the ?n?th distinct repeating character. For example, Input: Abracadabra, 1
sir i want small project with of health care system with struts and hibernate plz help me
sir i want small project with of health care system with struts and hibernate plz help me  sir i want small project on health care system with struts and hibernate plz help me
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
plz help
plz help  what is the procedure and code to design an interactive GUI in java using swings
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge

Ads