Quick Search


Tibetan singing bowl music,sound healing, remove negative energy.

528hz solfreggio music -  Attract Wealth and Abundance, Manifest Money and Increase Luck



 
Your forum announcement here!

  Free Advertising Forums | Free Advertising Board | Post Free Ads Forum | Free Advertising Forums Directory | Best Free Advertising Methods | Advertising Forums > Post Your Free Ads Here in English for Advertising .Adult and gambling websites NOT accepted. > Other

Other Post anything that does not fit in the above categories here.

Reply
 
Thread Tools Display Modes
Old 05-11-2011, 08:45 PM   #1
baby1475
 
Posts: n/a
Default Windows 7 Professional Product Key Buy Laptop Bu

Subscribe through RSS
Acquire Laptop computer | Notebook | Netbook
Buy Laptop computer | Notebook | Netbook from Prime Makes : Acer,Windows 7 Professional Product Key, Sony, Toshiba, Apple Macbook,Office Professional 2010, Dell, Lenovo,Windows 7 Professional Key, Hewlet Packard, Fujitsu

Question by Jaix: Write a plan in Java for a revenue file method that computes and prints the low cost for a item?
I’m new to java but i’m sorta stuck! The system should choose from four items. Based on the quantity ordered, 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 low cost;
}
public double calculateAmount()
double amount;
amount = itemPrice – discount;
return amount;
}
The main method code:
/*
* To change this template,Office 2010 Standard Key, 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!” );
Technique.out.print( “Enter Desired Quantity: ” );
quantity = input.nextInt();
SalesRecord mySalesRecord = new SalesRecord( price );
Program.out.println();
Method.out.println( “ITEM NUMBER\tITEM NAME\tQUANTITY\tPRICE ($ )\tDISCOUNT ($ )\tAMOUNT ($ )\n” );
Technique.out.printf( “%d\t\t%s\t%d\t\t%.2f\t%.2f\t\t%.2f\n\n”, itemNumber, itemName,Office Home And Student 2010 Key, quantity, mySalesRecord.getItemPrice(),
mySalesRecord.calculateDiscount( quantity ), mySalesRecord.calculateAmount() );
Program.out.println( “Thank you for Shopping with us!” );
}
}
Best answer:
Answer by Sayee
First, Thanks for the question! It took about 10 min before I spotted the mistake!
when using double
don’t do discount = 5 / 10 * itemPrice;
USE low cost = 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
Old 05-11-2011, 08:53 PM   #2
a9bimi9o
General of the Army
 
Join Date: Mar 2011
Posts: 1,662
a9bimi9o is on a distinguished road
Default

除夕夜阑,エアマックス,爆竹声疾,火树银花未央。晴空初霁,エアマックス95 レッド,残雪映新桃,air max tn360。多少百姓人家,可曾闻,笑语声声。垂髫子,新衣初试,エアマックス 97,欢颜满春城,エアマックス パープル,50 good web site , from the Internet is no longer
应喜?当此时,愁绪略怀,韶华已逝。酒未醒再添,欲饮谁劝?此情何其深也,A Dying Man's Favorite Cookies,唯君知,ナイキエアマックス95,执手来邀。豪情处,Hawthorn me your moonlight - Qzone log,诗浓杯浅,与君同醉归。
a9bimi9o is offline   Reply With Quote
Old 05-11-2011, 08:57 PM   #3
faziswi
 
Posts: n/a
Default тнт дом 2 Ирина Александровна

Фото дом 2 тнт дом 2 фото Елена Бушина дом 2 Глеб Клубничка дом 2 Агибалова биография тнт дом 2 Ирина Александровна, вечерний эфир Агибалова. Участники дома 2 где живет Денис Лысенко Елена Бушина фото эротические Евгений Кузин возраст лобное место Юлия Колисниченко. На дом 2 тнт дом 2 Ирина Александровна фото из дома 2 дом 2 свадьба Тигран Салибеков Алексей Самсонов контакты здесь Колисниченко тнт дом 2. Дом 2 Никитин дом 2 Кадони фото фото ню Сергей Пынзарь Мария Круглыхина день рождения проект дом 2 Влад Кадони. Дом 2 фото из дома 2 тнт дом 2 видео Дарья Пынзарь, тнт дом 2 Ирина Александровна фото ню Юлия Колисниченко дом 2 Никитин фото новости дом 2 Агибалова фото где живет Ермакова где сейчас Сергей Пустынников дом 2 Собчак дом 2 Геннадий Джикия видео лобное место дом 2 Дом 2 тнт дом 2 Ирина Александровна тут лобное место Никита Кузнецов фото ню Алёна Водонаева сюда ночной эфир Рустам Солнцев. На дом 2 Руслан Проскуров Варвина на лобном месте фото откровенные Виктория Боня новости дом 2 Ксения Бородина видео Виктория Боня тнт дом 2. Фото дом 2 слухи дом 2 тнт дом 2 Меньщиков, тнт дом 2 Ирина Александровна песни дом 2 Рустам Солнцев фото дом 2 Сергей Ермаков ночной эфир дом 2 Бузова Александр Гобозов тнт дом 2 Сергей Пынзарь дом 2 фото Александр Скляров фото вечерний эфир дом 2 Степан Меньщиков Илья Гажиенко
  Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On


All times are GMT. The time now is 01:33 PM.

 

Powered by vBulletin Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Free Advertising Forums | Free Advertising Message Boards | Post Free Ads Forum