View Single Post
Old 06-22-2011, 11:36 AM   #1
product102
 
Posts: n/a
Default Office Home And Business 2010 Product Key Buy Lapt

Subscribe via RSS ,Office Home And Business 2010 Product Key
Purchase Laptop | Notebook | Netbook
Buy Laptop computer | Notebook | Netbook from Best Brand names : Acer, Sony, Toshiba, Apple Macbook, Dell, Lenovo, Hewlet Packard, Fujitsu

Question by Jaix: Write a method in Java to get a income report system that computes and prints the low cost for a products?
I’m new to java but i’m sorta stuck! The method should choose from four items. Based on the quantity ordered,Microsoft Office 2010, if the quantity is 20 )

discount = 15 / 100 * itemPrice;
else if( order = 11 )

discount = 10 / 100 * itemPrice;
else if( order = 6 )

discount = 5 / 10 * itemPrice;
else

discount = 0;
return discount;
}
public double calculateAmount()
double amount;
amount = itemPrice – discount;
return amount;
}
The main method code:
/*
* To change this template,Office 2010 Standard, choose Tools | Templates
* and open the template in the editor.
*/
package salesrecord;
import java.util.Scanner;
/**
*
* @author Jikes
*/
public class SalesRecordTest {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int itemNumber = 0;
int quantity;
String itemName = “”;
double price = 0;
Scanner input = new Scanner( System.in );
System.out.println( “CURRENT ITEMS IN STOCK ARE LISTED BELOW:\n” );
System.out.println( “Item Number\t Item Name” );
System.out.println( “1)\t\t Dell 15\” Laptop\n2)\t\t HP Mini NoteBook\n3)\t\t Sony VIAO 12\” Tablet\n4)\t\t Apple MacBook Air” );
System.out.print( “\nEnter Desired Item Number: ” );
itemNumber = input.nextInt();
if( itemNumber == 1 )

price = 500;
itemName = “Dell Laptop”;
System.out.println( “You selected Dell 15\” Laptop\n” );
else if( itemNumber == 2 )

price = 400;
itemName = “HP NoteBook”;
System.out.println( “You selected HP Mini NoteBook\n” );
else if( itemNumber == 3 )

price = 800;
itemName = “Sony Tablet”;
System.out.println( “You selected Sony VIAO 12\” Tablet\n” );
else if( itemNumber == 4 )

price = 1300;
itemName = “MacBook Air”;
System.out.println( “You selected Apple MacBook Air\n” );
else

System.out.println( “Invalid Item Number Entered,Office Professional 2010!” );
Program.out.print( “Enter Desired Quantity: ” );
quantity = input.nextInt();
SalesRecord mySalesRecord = new SalesRecord( price );
Technique.out.println();
Method.out.println( “ITEM NUMBER\tITEM NAME\tQUANTITY\tPRICE ($ )\tDISCOUNT ($ )\tAMOUNT ($ )\n” );
Program.out.printf( “%d\t\t%s\t%d\t\t%.2f\t%.2f\t\t%.2f\n\n”, itemNumber, itemName, quantity,Office Ultimate 2007 Product Key, mySalesRecord.getItemPrice(),
mySalesRecord.calculateDiscount( quantity ), mySalesRecord.calculateAmount() );
System.out.println( “Thank you for Shopping with us!” );
}
}
Best answer:
Answer by Sayee
First,Buy Office 2010 a workaround to xp installs when the product key is missing.html, Thanks for the query! It took about 10 min before I spotted the mistake!
when using double
don’t do low cost = 5 / 10 * itemPrice;
USE discount = 5.0 / 10.0 * itemPrice;
change all numbers with an extra .0 in all the calculation lines similar to above and it should work fine!
Hope it helps.
What do you think? Answer below!
  Reply With Quote

Sponsored Links