Answered You can buy a ready-made answer or pick a professional tutor to order an original one.

QUESTION

Ex : 6.22 (Temperature Conversions) Implement the following integer methods:a) Method celsius returns the Celsius equivalent of a Fahrenheit temperature, using the calculationcelsius = 5.0 / 9.0 * (fa

Ex : 6.22 (Temperature Conversions) Implement the following integer methods:

a) Method celsius returns the Celsius equivalent of a Fahrenheit temperature, using the calculation

celsius = 5.0 / 9.0 * (fahrenheit - 32);

b) Method fahrenheit returns the Fahrenheit equivalent of a Celsius temperature, using the calculation

fahrenheit = 9.0 / 5.0 * celsius + 32;

c) Use the methods from parts (a) and (b) to write an application that enables the user either to enter a Fahrenheit temperature and display the Celsius equivalent or to enter a Celsius temperature and display the Fahrenheit equivalent.

Ex 6.25(Prime Numbers) A positive integer is prime if it’s divisible by only 1 and itself. For example,

2, 3, 5 and 7 are prime, but 4, 6, 8 and 9 are not. The number 1, by definition, is not prime.

a) Write a method that determines whether a number is prime.

b) Use this method in an application that determines and displays all the prime numbers

less than 10,000. How many numbers up to 10,000 do you have to test to ensure that

you’ve found all the primes?

Ex 5.24 (Diamond Printing Program) Write an application that prints the following diamond

shape. You may use output statements that print a single asterisk (*), a single space or a single newline character. Maximize your use of repetition (with nested for statements), and minimize the number of output statements.

Show more
  • @
  • 22 orders completed
ANSWER

Tutor has posted answer for $10.00. See answer's preview

$10.00

** *********** ******* Class:import javautilScanner; public class ****** *** public ****** **** ************* args) *** double ******* Scanner ** = new Scanner(Systemin);  Systemoutprintln("Enter *** radius ** ****** ** ******** ** User ***** radius * ***************** ********************** ** ****** ***** * * ****************** circleArea(radius)) * * ***** ********* *** public static ****** ***************** ******* *** ****** *** = *** * ** ****** **** * ************** **** ****************** *** ****** ** ****** ** *********** ** ****** ***** ***** ***** squareEx * *** (Temperature ************ Implement *** ********* ******* ********** Method ******* ******* *** Celsius ********** of * ********** *********** using *** ****************** * ** * ** * *********** - 32);b) ****** fahrenheit ******* *** ********** equivalent of * ******* *********** using *** ********************* * ** * ** * celsius * 32;c) *** *** methods **** parts (a) and (b) ** write ** *********** that enables the **** ****** ** ***** * Fahrenheit *********** *** ******* *** ******* ********** ** ** ***** * ******* temperature *** display *** ********** equivalent Solution:import javautilScanner; public ***** TempratureConversion *** ****** ****** double **************************** *********** * double ************* * *** * *** * *********** - **** ****** tempInCelsius; }  ****** ****** ****** ******************************* celsius) * ****** tempInFahrenheit * ((90 / *** * ******** * 32; ****** ***************** * public static void ************* args) *** ****** choice; ******* ** * *** Scanner(Systemin);  Systemoutprintln("Please ****** *** *** Systemoutprintln("a) ***** *********** ** Celsius"); Systemoutprintln("b) ***** *********** ** *************** ****** = scnextLine();  ** ******************* * Systemoutprintln(“Enter temperature in ******* **** ****** ******* = scnextDouble(); ***************************** ** ********** * ** *********************************** * **** if ******************* * *********************** *********** ** ********** **** ****** ********** * scnextDouble(); ***************************** ** ******* * ** getCelsiusTemperature(fahrenheit)); * **** * ************************* ********* } ******************* ****** ***** ***** *********** ** ********* ***** temperature ** **************** *********** in Celsius50Temperature ** ********** : ********** 625 (Prime ******** * ******** integer ** ***** ** it’s divisible by **** * *** ****** *** example2 3 * *** * *** prime but * * * *** * *** not *** number * ** ********** is not primea) ***** * ****** **** ********** ******* * ****** ** primeb) *** **** ****** ** an *********** **** determines *** ******** all *** ***** numbersless **** ***** *** many numbers ** ** ***** ** *** **** to **** to ****** ************ ***** *** *** ********************* PrimeFinder *** ****** ****** void main(String ******* {  Systemoutprintln(" ************ ***** Numbers >>>"); *** (int * = ** i <= 10000; **** { if ************ * ****************** * * *** } * }  public ****** ******* isPrime(int **** {  int ********* = ***** Mathsqrt(num); for **** * = ** * ***** ********** **** * ** **** * i ** ** { ****** false; * * ****** ***** ********* <<< Prime ******* >>>235711131719232931374143475359616771737983899710110310710911312713113713914915115716316717317918119119319719921122322722923323924125125726326927127728128329330731131331733133734734935335936737337938338939740140941942143143343944344945746146346747948749149950350952152354154755756356957157758759359960160761361761963164164364765365966167367768369170170971972773373974375175776176977378779780981182182382782983985385785986387788188388790791191992993794194795396797197798399199710091013101910211031103310391049105110611063106910871091109310971103110911171123112911511153116311711181118711931201121312171223122912311237124912591277127912831289129112971301130313071319132113271361136713731381139914091423142714291433143914471451145314591471148114831487148914931499151115231531154315491553155915671571157915831597160116071609161316191621162716371657166316671669169316971699170917211723173317411747175317591777178317871789180118111823183118471861186718711873187718791889190119071913193119331949195119731979198719931997199920032011201720272029203920532063206920812083208720892099211121132129213121372141214321532161217922032207221322212237223922432251226722692273228122872293229723092311233323392341234723512357237123772381238323892393239924112417242324372441244724592467247324772503252125312539254325492551255725792591259326092617262126332647265726592663267126772683268726892693269927072711271327192729273127412749275327672777278927912797280128032819283328372843285128572861287928872897290329092917292729392953295729632969297129993001301130193023303730413049306130673079308330893109311931213137316331673169318131873191320332093217322132293251325332573259327132993301330733133319332333293331334333473359336133713373338933913407341334333449345734613463346734693491349935113517352735293533353935413547355735593571358135833593360736133617362336313637364336593671367336773691369737013709371937273733373937613767376937793793379738033821382338333847385138533863387738813889390739113917391939233929393139433947396739894001400340074013401940214027404940514057407340794091409340994111412741294133413941534157415941774201421142174219422942314241424342534259426142714273428342894297432743374339434943574363437343914397440944214423444144474451445744634481448344934507451345174519452345474549456145674583459145974603462146374639464346494651465746634673467946914703472147234729473347514759478347874789479347994801481348174831486148714877488949034909491949314933493749434951495749674969497349874993499950035009501150215023503950515059507750815087509951015107511351195147515351675171517951895197520952275231523352375261527352795281529753035309532353335347535153815387539353995407541354175419543154375441544354495471547754795483550155035507551955215527553155575563556955735581559156235639564156475651565356575659566956835689569357015711571757375741574357495779578357915801580758135821582758395843584958515857586158675869587958815897590359235927593959535981598760076011602960376043604760536067607360796089609161016113612161316133614361516163617361976199620362116217622162296247625762636269627162776287629963016311631763236329633763436353635963616367637363796389639764216427644964516469647364816491652165296547655165536563656965716577658165996607661966376653665966616673667966896691670167036709671967336737676167636779678167916793680368236827682968336841685768636869687168836899690769116917694769496959696169676971697769836991699770017013701970277039704370577069707971037109712171277129715171597177718771937207721172137219722972377243724772537283729773077309732173317333734973517369739374117417743374517457745974777481748774897499750775177523752975377541754775497559756175737577758375897591760376077621763976437649766976737681768776917699770377177723772777417753775777597789779378177823782978417853786778737877787978837901790779197927793379377949795179637993800980118017803980538059806980818087808980938101811181178123814781618167817181798191820982198221823182338237824382638269827382878291829382978311831783298353836383698377838783898419842384298431844384478461846785018513852185278537853985438563857385818597859986098623862786298641864786638669867786818689869386998707871387198731873787418747875387618779878388038807881988218831883788398849886188638867888788938923892989338941895189638969897189999001900790119013902990419043904990599067909191039109912791339137915191579161917391819187919992039209922192279239924192579277928192839293931193199323933793419343934993719377939193979403941394199421943194339437943994619463946794739479949194979511952195339539954795519587960196139619962396299631964396499661967796799689969797199721973397399743974997679769978197879791980398119817982998339839985198579859987198839887990199079923992999319941994999679973 Ex 524 (Diamond ******** ******** Write ** *********** **** ****** *** ********* ************ You *** use ****** ********** **** ***** * single ******** (*) a ****** space ** a ****** ******* ********* ******** your *** ** ********** (with nested *** *********** and ******** the number of ****** ****************** ******* ******************************* ************************ ***** GuessNumber *** ****** ****** **** ************* ***** {  ********************* *** ******* ************ randomNumbers * *** ***************** ******* ****** = ****** ** { int ************ * * * randomNumbersnextInt(1000); *** ***** * **** while ************* ** ****** * ******* ** * new ****************** ************************* a ****** ******* 1 *** ******* ***** * ************** if ****** > ************* * ********************* High *** again"); * else ** ****** **** ************* { Systemoutprintln("Too Low Try ******** * **** * ********************************* You guessed *** ********** } }  ******* **** * new Scanner(Systemin); Systemoutprintln("Would *** **** to **** ***** * (Press N ** **** )"); ****** entry * scannextLine(); ** **************************** * choice = false; ********************* *** *** **** *** !"); } else * ****** * ***** * } while ********* ************ *** mind Guess * ****** between * and ********** **** Try again Guess * ****** ******* * *** ********** **** *** again Guess * ****** ******* * *** ********** Low Try again Guess * ****** ******* * *** ********** *** *** ************ * number between * *** ********** *** Try ************ * number ******* * *** ********** **** *** ************ * ****** ******* * *** ********** High *** again Guess * ****** ******* * *** 1000215Too **** *** ************ * number between * *** ********** **** Try ************ a ****** ******* 1 *** ********** *** *** ************ * number ******* * and ********************** *** ******* *** ************ you **** to **** again * ****** N ** **** )nYou did *** good *** *

or Buy custom answer
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question