Can someone help me code the statments in the picture?

Can Someone Help Me Code The Statments In The Picture?

Answers

Answer 1

Answer:

(In this section I will put the code with no comments and I'll put the code plus comments in the explanation below :)

public class Main

{

   public static void main(String[] args)

   {  

      double cost = ParkingSpot.getPrice(4);

      System.out.println(cost);

   }

}

//End OF Main class

//ParkingSpot class

public class ParkingSpot

{  

   public static double getPrice(int hours)

   {

   double cost = 4.25 * hours;

     

       if (cost < 7.00){

           cost = 7.00;

       }

       if (hours > 3){

           cost = cost * 0.25;

       }

       return cost;

 

   }

}

Explanation:

(Here I will add the comments so you better understand what is written and whats going on :)

public class Main

{

   public static void main(String[] args)

   {

    /* the code should be written in the ParkingSpot

      * class. You may use this main method to call

      * methods to test your code

      */

       

      /*We send an integer representing x amount of hours, also calling the

       method and displaying the result

      */

      double cost = ParkingSpot.getPrice(4);

      System.out.println(cost);

   }

}

//End OF Main class

//ParkingSpot class

public class ParkingSpot

{

   /* Finish the static class getPrice. The parameter hours indicates the time parked.

    */

   public static double getPrice(int hours)

   {

   //Here we set the rates

   /*

       It costs 4.25 per hour to park in the ParkingSpot

       If the total cost come in at less than 7.oo, the price should

           be adjusted UP to 7.00, the minimum Price Allowed

       If the number of hours is more than three hours,  

           a 25% discount should be appllied  

   */

   

   double cost = 4.25 * hours;

   

   //If the cost is less than 7.00 we set the price up to 7.00

       if (cost < 7.00){

           cost = 7.00;

       }

  /*If hours is more than 3 (meaning 4 or it would have said 3 and/or more),  

   a 25% discount will be appllied*/

       if (hours > 3){

           cost = cost * 0.25;

       }

   

   //Return cost of parking for x amount of hours

       return cost;

 

   }

}


Related Questions

WHO IS BEST FREE FIRE PLAYER IN WORLD?

Answers

Answer:

SULTAN PROSLO

Is known to be the best free fire player.

Select the correct answer.
Which of these practices should you avoid in navigation design?
O A. linking the organization logo to the home page
O B. providing users with different types of navigation elements
OC. providing users with as many choices as space allows
OD. using metaphor to represent real-life objects

Answers

Answer:

C

Explanation:

Coming from a purely practical point of view, providing users with as many choices as space allows is a bad idea. You do not want to overwhelm a navigation bar with too many options, especially not "as many choices as space allows". You should keep them short and if need be, categorised.

Hope this helps!

recent top-level domains include _____. select all that apply.

Answers

Answer:

.aaro, .mobi

Explanation: these domains are now available in the root zone. Similar to .com and .gov

On which of the following space objects would scientists most likely expect to find life?

A
a planet with no solid surface

B
a planet with an ocean on its surface

C
a large planet very far away from the Sun

D
a small, rocky planet with no atmosphere

Answers

Answer:

B ocean planet

Explanation:

one of the criteria astronomers set to determine if a planet is habitable is the planet having liquid water on its surface.

drawing tablet cursor goes to top left corner of screen when pen is away

Answers

Answer:

This is just my opinion I think the answer might be A

How can you distinguish a field from other text in a main document in a mail merge?
Group of answer choices

Fields are always formatted as bold text.

Fields are always italicized.

Fields are surrounded by cheverons. (<< >>)

Answers

Answer:

Most likely

"Fields are surrounded by cheverons. (<< >>)"

Explanation:

"My pet named Steve."
Who said this?

Answers

Answer:it seems you have said it

Explanation:

....

you did. explanation- ur mom!!

The terms mainframe computer and supercomputer are interchangeable: both refer to the largest, most powerfut computers. O True O False​

Answers

Answer:

False

Explanation:

A mainframe computer is way more commonly available than a supercomputer as it is not as powerful/costly.

The statement "The terms mainframe computer and supercomputer are interchangeable: both refer to the largest, most powerfut computers." is false.

Is the statement true or false?

The terms "mainframe computer" and "supercomputer" are not interchangeable, as they refer to different types of computers with distinct purposes, architectures, and applications.

Mainframe Computer: Mainframes are large, powerful, and highly reliable computers designed to handle massive amounts of data processing and perform complex transactions. They have been traditionally used in organizations and industries that require high-speed processing, such as financial institutions, government agencies, and large corporations. Mainframes are known for their robustness, scalability, and ability to handle multiple tasks simultaneously. They are typically used for tasks like processing large databases, running critical business applications, and supporting many users concurrently.

Supercomputer: Supercomputers, on the other hand, are the most powerful computers in terms of processing speed and performance. They are specifically designed to solve extremely complex problems and perform intensive numerical calculations at very high speeds. Supercomputers are commonly used in scientific research, weather forecasting, simulations, and other computationally demanding tasks. They are optimized for parallel processing, which allows them to divide complex tasks into smaller parts and process them simultaneously.

While both mainframe computers and supercomputers are powerful machines, they serve different purposes. Mainframes are geared towards transaction processing and business applications in large organizations, whereas supercomputers are focused on scientific research and high-performance computing tasks. Their architectures, hardware, and software configurations are tailored to their specific functions, making them distinct types of computers in the world of advanced computing.

Learn more about supercomputers:

https://brainly.com/question/27291413

#SPJ3

which cyber protection condition establishes a protection priority focus

Answers

The cyber protection condition which establishes a protection priority focus on critical and essential functions only is: INFOCON 1.

INFOCON 1 is an acronym for information operations condition and it can be defined as a situation that describes a successful attack on an information system with definite impacts on Department of Defense (DoD) missions but the defense system of the computer network is at maximum alertness.

Basically, INFOCON 1 ensures the maximum alertness or highest readiness of a computer network defense system to address intrusion (cyber attack) techniques that can't be identified or defeated with lower readiness.

In conclusion, INFOCON 1 is a cyber protection condition which establishes a protection priority focus on critical and essential functions only.

Read more: https://brainly.com/question/24112967

what is the relationship between energy incoming to the earth from the sun and the size of a food web?

Answers

Answer:

Food chains track the progress of energy through organisms, and food webs show the interconnectedness between food chains. All food webs begin with the sun. Generally, plants take the energy from the sun to make their own food. Other animals then eat the plants to convert the plant's food into its own food. If a second animal eats the plant eater, then the meat from the plant eater becomes energy for the meat-eating animal. When the meat-eating animal dies, its body becomes energy for tiny bacteria and other decomposing organisms, which break its body down.

Producers in a food chain or food web take the sun's light and convert it into food through photosynthesis. This group composes the largest group of organisms on Earth. Sugar results from photosynthesis, wherein plants or algae take sunlight, carbon dioxide and water and produce food (sugar) and oxygen. Effectively, the sun's energy triggers the beginning of the energy transfer in the food web.

Producers make their own food, but the higher organisms must eat the plants or other animals to get their own food. Since they consume other beings, these organisms are known as consumers. Of these consumers, herbivores eat plants and predators consume other animals. Without the action of the producers to turn sunlight into food, the producers would die, and consumers that rely on them would lose their food source and die too.

Explanation:

Why does your e-learning course need a title slide?

Answers

Answer:

You've probably noticed that many e-learning courses start with a title slide. ... Your title slide is important because it's the first impression users get of your course—and learners do judge e-learning courses within moments of launching them! So take the opportunity to captivate them with a great-looking title slide.

Answer:

if u don't mind I agree with above ans

PLS HELP WITH MY PYTHON HW ILL GIVE YOU BRAINLIEST

Answers

Answer:

class Cat:

   isHungry = None

play = Cat().isHungry = True

eat = Cat().isHungry = False

if play:

   print("I am hungry, I cannot play")

else:

   play = Cat().isHungry = False

if eat:

   print("I am full, I cannot eat")

else:

   eat = Cat().isHungry = True

Explanation:

Just simple if and else statements.

being able to download a chapter of a new book before buying it or trying out a software option for a month before purchasing are examples of which aspect of the 4e framework?

Answers

Answer:

Experience the product

Explanation:

Being able to download a chapter of a new book before purchasing it is an example of how consumers can experience the product.

¿importancia del técnico de soportes en redes y sistemas informáticos?

Answers

Answer:

responsable de manejar errores de instalación, problemas del usuario y cualquier otro problema técnico que impida que el cliente utilice su producto. En esencia, el soporte técnico se centra en ayudar a los clientes a utilizar un producto de forma más eficaz.

RAM is like a computers ___, while a hard drive is like a computers___



A. brain/ nervous
B. nervous system/ brain
C. long-term memory/ short-term memory
D. short-term memory/long-term memory

Answers

Answer:

D. short-term memory/long-term memory

Explanation:

RAM is like a computer's short-term memory, while a hard drive is like a computer's long-term memory. Then the correct option is D.

What are RAM and Hard drive?

Random Access Memory is referred to as RAM. RAM is referred to as Basic Memory or Main Memory. Each RAM memory location may be accessed at the same speed. The computer will slow down if RAM is low. RAM has a brief read/write (R/W) period. Transistors and other electronic components make up RAM, which has no moving mechanical elements.

Hard Disk Drive is referred to as HDD. Another name for HDD is supplementary memory. HDD has mechanical moving components like an arm, a pin, etc. HDD read/write times are faster. It could take longer or shorter to access different parts of the HDD. The impact of HDD on system speed is minimal.

A hard drive is comparable to a computer's long-term memory, whereas RAM is like short-term memory. D is the best choice in that case.

More about the RAM and Hard drive link is given below.

https://brainly.com/question/17944253

#SPJ2

This feature allows you to adjust your view to see the lower and upper part of a document

Answers

Scroll bar i hope this helps :D

Answer: scroll bar

Explanation: It allows you to change your view from side to side and up and down

:D

What type of software repairs or improves a larger application that is already installed on a system?
O spreadsheet
O mapping
O patch
O anti-virus

Answers

Answer:

Mapping

Explanation:

Hope it helps you

1. The correct definition of ergonomics is: (a) The correct way to position your feet when in front of electronic equipment. (b) How to use a computer to view safety software. O (c) The creation and adjustment of products and systems, so that they are comfortable and safe for day to day use. (d) The creation of products and systems that will not be so comfortable so as to cause the user to fall asleep while using it.​

Answers

Answer:

I'd assume it's C.

Explanation:

hope this helps!

According to which virtue do you need to secure information by limiting computer access to authorized personnel only?

Answers

Answer:

Confidentiality is a virtue which states that you need to secure information by limiting computer access to authorized personnel only.

Helpppp
You can see the output if your html result using any web browser ?
True or False

Answers

True, html code can be seen using any web browser. All web browsers support the most renown and definitely mostly used website designer code language. From chrome to Firefox to safari, you will have no problems checking out your code.

this endpoint does not support blobstorageevents or softdelete. please disable these account features if you would like to use this endpoint.

Answers

Answer:

A

Explanation:

Endpoint mover is one of the graph tools that has gives the tendency for manipulation of lines or curves. When this manipulation is done, it add some few values to the ploted points so as to achieve a desired line or curve.

What is content filtering ?

Content filtering has been the process of the screening and or restricting access to objectionable email, webpages, executables, and other suspicious items using software or hardware. Filtering software can detect objectionable or criminal content, such as hate sites, illegal content, and social media.

As the part of their internet firewalls, businesses frequently employ content-based filtering, also known as information filtering. Content filtering, a common security measure, assists businesses in enforcing corporate policies regarding the use of information systems, such as the filtering and blocking of employee access to social media platforms.

Therefore, Endpoint mover is one of the graph tools that has gives the tendency for manipulation of lines or curves. When this manipulation is done, it add some few values to the ploted points so as to achieve a desired line or curve.

To learn more about content filtering , visit

https://brainly.com/question/13129235

#SPJ2

Which 2 tools are useful to remote employees and coworkers.

Answers

Two big useful tools are one, File Storage tools, and two, Project Management Tools.

What is a problem (worldwide or personal) that was solved by social media?
I need to write about some sort of problem that what fixed by the use of social media

Answers

You could write about any natural disaster, in which through social media they were able to raise funds to help those affected by said disaster

Which of these is a historic real-world simulation game?

A. Juggling
B. Archery
C. Golf
D. Tag

Answers

Answer:

B. Archery

Explanation:

the art, practice, or skill of shooting with bow and arrow

Answer:

B. archery

Explanation:

Who was your first video game crush? Be 100% honest!

Answers

Answer:

princess peach

what are the advantage and disadvantage of super disk,in point???
urgently ​

Answers

Answer:look over this

Explanation:

https://en.wikipedia.org/wiki/SuperDisk

Write a code segment that will store a dinner selection in option1 based on the values of rsvp and selection. The intended behavior of the code segment is described below. If rsvp is true, the code segment should store in option1 a string indicating the person’s attendance and food choice. For example, if rsvp is true and selection is 1, the following string should be stored in option1. "Thanks for attending. You will be served beef." If rsvp is false, the following string should be stored in option1, regardless of the value of selection. "Sorry you can't make it." Write the code segment below. Your code segment should meet all specifications and conform to the examples.

Answers

The code segment illustrates the use of conditional statements.

The execution of conditional statements is dependent on the truth value of its condition.

The required code segment is as follows:

if (rsvp == true && selection = 1){

      option1 = "Thanks for attending. You will be served beef.";

}

else{

option1 = "Sorry you can't make it.";

}

The flow of the above code segment is as follows:

Check if rsvp is true and selection is 1; if yes, "Thanks for attending....." is saved in option1If otherwise, "Sorry...." is saved in option1

The code segment submitted can be used for several programming languages such as Java, C++, C and C#.

Read more about similar programs at:

https://brainly.com/question/14166674

2. YOU CANNOT IGNORE A SUGGESTION GIVEN BY WORD TO SAY YOU SHOULD CORRECT A SPELLING ERROR. *

True
False

Answers

Answer:

False

Explanation:

If you spell a word that Microsoft Word doesn't recognize, you can always click the little opened book icon (the spelling check book will appear with either an x or a check mark) at the bottom left hand-corner, and you have the option to ignore the misspelled word.

Hope this helped :)

If it didn't, then I'm sorry

What is the sixth generation of style. When writing a paper.

Answers

Answer:

Scribbr

Explanation:

A column does not consist of
cells that are on the same
vertical line within a worksheet.
True
False
(microsoft excell)

Answers

Answer: false

Explanation:

columns are vertical, rows are horizontal

The statement "a column does not consist of cells that are on the same vertical line within a worksheet" is definitely false.

What is a vertical line of cells in a spreadsheet is called?

A vertical line of cells in a spreadsheet is called Gridline. Gridlines are the horizontal and vertical lines on the screen that separate cells in a spreadsheet. Columns run vertically in the worksheet, and the data goes from up to down. Column A is the first column in Excel.

While rows run horizontally in the worksheet. A row is a series of data put out horizontally in a table or spreadsheet, while a column is a vertical series of cells in a chart, table, or spreadsheet.

Therefore, the statement "a column does not consist of cells that are on the same vertical line within a worksheet" is definitely false.

To learn more about Columns and rows in the worksheet, refer to the link:

https://brainly.com/question/5940146

#SPJ2

Other Questions
5.3g + 8 = 3.3g + 20 When acids dissolve in water, what is released into the resulting solution? H+ and OH-ions equally H+ (hydrogen) ions OH- (hydroxide) ions What is the slope of (-5,8) (-3,12) as an american empresario, green dewitt was able to do any one need points How did cultural exchanges and the work of Islamic scholars produce lasting achievements q is directly proportional to p q = 21 when p = 9, the value of q when p =16 is -1/3x-1/6=2/9 solution Edward opens a new account and makes a deposit of $150. He then makes withdrawals of $10, $20 and $25, before depositing $30 more. What is the new balance? need hep with this question Read the blog entry below and answer the question that follows:At first I dreaded going to sixth grade camp. I was sure the food would be poisonous, I would freeze to death in my sleeping bag, and the other kids in my cabin would never talk to me. But was I wrong! In fact, it was the best week ever! I went horseback riding and participated in a ropes activity with a zip line course. After the course, I climbed to the top of a pole using only ropes and carabiner clips, and then I rappelled off the top. I even made a new best friend. Oh, by the way, the food was delicious. It tasted better than my mom's! (But don't tell her.)Review the first sentence:At first, I dreaded going to sixth grade camp.What is the connotation showing here? A The author was impatient and could not wait to get to camp.B The author was worried he/she might not enjoy camp.C The author welcomed the opportunity to go camping.D The author was excited about going to camp. place the boxes in the correct location this Math problem 15 points What is the standard form of function f?f(x)=4(x+6)+5Substitute numerical values into the equation for a, b, and c. PLEASE HELP WILL MARK BRAINLIEST NO FAKE ANSWERS OR WILL BE REPORTEDEvaluate the expression IN EXPONENTIAL FORM ASAP PLEASE HELP PART 3!! Define exemption, deviation, or a waiver. Define each one and then provide an example of each that includes the regulation, a summary of the requesters rationale and justification, the FAA position, and then your position on the FAA decision. Your examples can be for a manned or unmanned aircraft. plz help fast. Which of the following represents a chemical change? (2 points)1. decomposition of stone due to acid rain2. iron's attraction to a magnet3. the pink color of a rose4. rocks being smoothed by rapid water movement Anyone know thiss?I need helpppp!! maths ..................... helphelphelp due in 5 minutes answer the question below