Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java 4) Write a single line of Java code that does each of the following: a) Prints out Yay! if a boolean variable named win

java
image text in transcribed
4) Write a single line of Java code that does each of the following: a) Prints out "Yay!" if a boolean variable named win is true and "Boo0ol" if win is false. b) Prints out the value in a double variable named result rounded to 6 decimal places. c) Sets an integer variable named i to be the minutes value of a String named 3 which holds a time in the following format: 2 digits for the hours, then a ": ", then 2 digits for the minutes, then a ":", then 2 digits for the seconds, then am or pm. For example: if s is 11:15:05pm 1 should be set to 15. (You do not need to check if a is valid)

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

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions

Question

create a reaume as a grocery clerk ?

Answered: 1 week ago