Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. (15 points) a. Write an if/else statement that assigns true to the variable fever if the variable temperature is greater than 98.6; otherwise it

image text in transcribed
3. (15 points) a. Write an if/else statement that assigns true to the variable fever if the variable temperature is greater than 98.6; otherwise it assigns false to fever. b. On what values of temperature would you test your code in part a, in order to test each path and boundary as we discussed in class (Oust with respect to the code in part a) ? 4. (15 points) Re: Chapter 3, we used fragment below, till in the blanks, so that positionorspace, firstInitial and lastInitial are assigned predefined classes such as Math and String. In the code appropriately, in order to extract the first and last initials from fulName. the String class. Here is the This requires calling methods which are already defined in ocumentation that the Java Standard Library provides for relevant String methods. You need not invoke all of these methods. Your code should extract the initials of any int indexor (re index vithin thi ttaT the epecified subetring fgiven PAran within this string of the tirst oceurrence ot e tenth tare har-te Etring eubetring (int beginndex, int endindex) ring that i..ubat ring of thi. 8tring. The begina the speeitsed begintndex and extends to the charaeter charcharat (int index) turna thre char value at the apeeified Lndeax // Read a full nane from the user as -iret Last aystem out.printla (Koter your full name an Pirst Laat String fulNane- can.nextLine /Pind the e index of the space in fullame, the string entered by the usex /the apace separates the tirat and last nanes int poaitionotspace / Rxtract the tirat and last initiale. / For example, i uliNane ia "Ted Murphy". // then firstlni tial i" T' and iastinitial ia ,H. code should work tor any example /Note: the data types are missing miesing for firstInitial and lastinitial first firatInitial --last Initial

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago