Java Codelab Solutions - Section 2.2.3
Java Codelab Solutions - Section 2.2.3
Java Codelab Solutions - Section 2.2.3
3FloatingPointDataTypes
20541:Declareafloatvariablenamedprice.
floatprice
20542:DeclareadoublevariablenamednetWeight.
doublenetWeight
20511:Declareavariablex,suitableforstoringvalueslike3.14159and6.02E23.
floatx
20980:Writeasinglestatementthatwillprintthemessagefirstisfollowedbythevalueoffirst,andthenaspace,followed
bysecond=,followedbythevalueofsecond.Printeverythingononelineandgotoanewlineafterprinting.Assume
thatfirsthasalreadybeendeclaredasadoubleandthatsecondhasbeendeclaredasanint.Assumealsothatthe
variableshavealreadybeengivenvalues.
System.out.println("firstis"+first+"second="+second+"\n")