Home Answers Viewqa Java-Beginners plz Help me find the correct programs answers

 
 


nitesh Sah
plz Help me find the correct programs answers
2 Answer(s)      2 years and 5 months ago
Posted in : Java Beginners

  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 nitesh_loveguy@yahoo.co.in. 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);
    }

}

}









Related Pages:
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
Help me quickly plz??
Help me quickly plz??  Can you help me to write code quickly this code is a java code take input as double and should use command line arguments and enhanced for statement then find the combine of the numbers plz help quickly
Plz Provide correct program code for all questions.
Plz Provide correct program code for all questions.   Write a program to find the difference between sum of the squares and the square of the sums... of the cylinder. Utopias tax accountants always use programs that compute income taxes
Plz give the answers - Java Interview Questions
Plz give the answers  1.Computing cos(x) using the cosine series...), is the number itself. Write a JAVA program to find all perfect numbers between 2... the console   Hi friend, Code to help in solving the problem
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 - Java Interview Questions
plz help me  1)Rewrite the method in exercise 10 such that it use the binary search algorithm instead. the linear search algorithm is suitable... java.util.*; public class LinearSearch{ public int find (final int [] data
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
Gui plz help
Gui plz help   Create a Java application that would allow a person... ?Good Job? if the ratio of correct to incorrect answers exceeds 70% or you... it do only 10 questions for button1 and not able to add them so i can get answers
plz help me - Java Beginners
plz help me  Deepak I can write a sessioon code plz help me admin_home.jsp page is display but data is not disply plz help me what is wrong
plz plz plz inform me as soon as possible
plz plz plz inform me as soon as possible  ``by using c programs how to type
plz help me - Java Beginners
plz help me  Hi, I want to search all field from database using name, and display in text box, then data is update and delete. i want to search name using alphabets a-z, plz reply fast. plz help me this is very urgent
plz Help me - Java Beginners
plz Help me  Hi, I want learn struts,I dont have any idea about this plz help how can i make a framework.If u have any information then plz send my personal id plz tell me that whose software installed.and give me brief
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
plz give me answer plz
plz give me answer plz  writw a programme to find rank from an array using doubledimmensionalarray
plz help me - Java Beginners
plz help me  Thanks deepak continue response..i face some problem i... is true...but i very confuse that how it is not displayed admin page plz any one give me reponse my persinal given id  Hi ragni, i am sending
plz help me!!!!!!!! - JSP-Servlet
plz help me!!!!!!!!  i`ve set the environment varaibles for tomcat as well as jdk.. but i`m not understanding where i`ve to save my servlet..i.e.... there are compilation errors.. plz do help me.   make sure that you did
java mail programs
output.actually,do I need a mail server to get correct output of these codes?plz help me, I have to make a web application which helps to send mail,plz give me a solution
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
i want to find the byte code of a image file ... for my project..plz if anybody help me for java coding i will grateful..
i want to find the byte code of a image file ... for my project..plz if anybody help me for java coding i will grateful..   i want to convert a image file to its byte code format that help me for the pattern matching in my
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
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
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 help me today plz plz - Java Interview Questions
plz help me today plz plz  2.) Suppose list is an array of six elements of type int. What is stored in list after the following java code executes? . for (i = 0; i < 5; i++) { list[i] = 2 * i + 5
Plz help me in writing the code - Java Beginners
Plz help me in writing the code   Write a two user Chess Game. (users must be on different systems
Plz help me in writing the code - Java Beginners
Plz help me in writing the code   Write a two user Chess Game. (users must be on different systems
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
facing problem plz help me out - Framework
Facing problem plz help me out  hi i am new to servlet i deployed... the web.xml file too parallel to the classes folder now i am facing this problem.plz tell me what to do... error:The requested resource (Servlet servlet
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
Help Me With This Plz - Java Interview Questions
Help Me With This Plz  Write a program that's print a word like(I S E) on the black screen with 0,1 only by using two dimensional array? the 1's will represent the words
Plz help me with this Question - Java Beginners
Plz help me with this Question  this is java code ------------------------- Consider the following code: int [ ] a = [1, 2, 3]; Object o ="123"; String t = "12"; String w = t + "3"; Boolean b = o.equals (a); Boolean b2
help me plz - Java Interview Questions
help me plz  1)write a java program that prompts the user to input a decimal number and print the number rounded to the nearest integer? 2)write...? plz answer my question   Hi Friend, Try the following code: 1
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
java, plz help me in doing this - Java Beginners
java, plz help me in doing this  # Write a small record management application for a school. Tasks will be Add Record, Edit Record, Delete Record.....giving me the error of NoClassDefFoundError
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 give me code for this question
Plz give me code for this question  Program to find depth of the file in a directory and list all files those are having more number of parent directories
Help me
Help me  plz i want code of program to add real numbers and magic numbers in java example this input :- 5+3i-2+3i output:- 3+6i
Interview Questions and Answers
are preparing yourself to handle. “I find that it is difficult for me to make... Interview Questions and Answers   ... that there cannot be just one answer to them. Your answers depend a lot on your particular
help me
in the beginning will ake the uesr to which system he/she wants to be transferred. plz help me
help me
the order, Fourth button is Find length of text. and there are panels. Please help me...help me  Dear sir/medam i would like to know how to use the java string class method my programm have four button,(enter the text) that first
plz help - Java Beginners
plz help  i have to programs and it takes too long to run them so i got a solution that makes programs run much faster which is threading programming.. but i dont know how to aplly that on my 2 programs: the first code
need the answer vry urgently..plz help me...[plzzzzzzzz
need the answer vry urgently..plz help me...[plzzzzzzzz  the question... code...hpw to write in eclipse platform....plz plz mail me...to panda.pragnya7@gmail.com/panda_pragnya@yahoo.com...plz plz...help....me..it can change my lyfe
plz help me to write a snake game using swings - Swing AWT
plz help me to write a snake game using swings  write snake game program using swings
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
How to get the correct value by calculating double values....
duration 59 i am getting wrong cost .. Sir plz help me in this code.Thank you Sir...How to get the correct value by calculating double values....  Hello Sir, I have a method in which i am getting getting wrong
Please help me to solve these programs in Python - Java Beginners
Please help me to solve these programs in Python  1. Write a program that prints an n-level stair case made of text. The user should choose the text character and the number of stairs in the stair case

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.