1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
alexdok [17]
3 years ago
8

Given the following code fragment and the input value of 4.0, what output is generated?

Computers and Technology
1 answer:
kicyunya [14]3 years ago
4 0

Answer:

c) 4.4

Explanation:

You can evaluate step by step the code. You know tha your input is 4.0

Step 1 Variables definitions:

double tax;

double total;

Step 2 Ask the user for the input:

System.out.print("Enter the cost of the item");

Step 3 read de input:

total = scan.nextDouble();

Step 4 evaluate the condition (  is the input greater or equal  than 3.0 ? [True])

if ( total >= 3.0)

Step 5 get done the operations inside the condition and print it:

tax = 0.10;

System.out.println(total + (total * tax));

You might be interested in
1. Write a high level algorithm for cooking a cheeseburger.
pishuonlain [190]

Answer:

1.  A high level algorithm for cooking a cheeseburger could be:

  1. Heat fry pan
  2. Cook one side of the hamburger
  3. Wait
  4. Turn hamburger upside down
  5. Put cheese over hamburger
  6. Wait
  7. Cut hamburger bread in half
  8. Put cooked hamburger inside bread
  9. End (eat)

2. A detailed algorithm for cooking a cheeseburger could be:

  1. Place fry pan over the stove heater
  2. Turn on heater (max temp)
  3. IF fry pan not hot: wait, else continue
  4. Place raw hamburger on fry pan
  5. IF hamburger not half cooked: Wait X time then go to line 5, else continue
  6. Turn hamburger upside down
  7. Put N slices of cheese over hamburger
  8. IF hamburger not fully cooked: Wait X time then go to line 8, else continue
  9. Turn off heater
  10. Cut hamburger bread in half horizontally
  11. Put cooked hamburger on one of the bread halves.
  12. Put second bread half on top of hamburger
  13. End (eat)

Explanation:

An algorithm is simply a list of steps to perform a defined action.

On 1, we described the most relevant steps to cook a simple cheeseburger.

Then on point 2, the same steps were taken and expanded with more detailed steps and conditions required to continue executing the following steps.

In computational terms, we used pseudo-code for the algorithm, since this is a list of actions not specific to any programming language.

Also we can say this is a structured programming example due to the sequential nature of the cooking process.

7 0
3 years ago
Renting provides _________ flexibility but can lead to _________ costs in the long-term.
docker41 [41]
Renting provides greater flexibility but can lead to higher costs in the long term.
3 0
3 years ago
Read 2 more answers
Over a TCP connection, suppose host A sends two segments to host B, host B sends an acknowledgement for each segment, the first
irinina [24]

Over a TCP connection, suppose host A sends two segments to host B, host B sends an acknowledgement for each segment, the first acknowledgement is lost, but the second acknowledgement arrives before the timer for the first segment expires is True.

True

<u>Explanation:</u>

In network packet loss is considered as connectivity loss. In this scenario host A send two segment to host B and acknowledgement from host B Is awaiting at host A.

Since first acknowledgement is lost it is marked as packet lost. Since in network packet waiting for acknowledgement is keep continues process and waiting or trying to accept acknowledgement for certain period of time, once period limits cross then it is declared as packet loss.

Meanwhile second comes acknowledged is success. For end user assumes second segments comes first before first segment. But any how first segment expires.

3 0
3 years ago
Which of the following statements are true?
ipn [44]

Answer:

d. CSS can be included in an HTML document

Explanation:

HTML (Hypertext Markup Language) and CSS (Cascading Style Sheets) are not <em>programming languages</em>. They are, in fact, a different kind of <em>computer languages</em> and are some of the essential tools used in common web pages nowadays.

HTML and HTML5 are <em>different</em>. The latter is a new version of HTML which implies some improvements such as the availability of other technologies and features not found in HTML.

HTML is a <em>markup language</em>, i. e., a kind of computer language like <em>TeX</em>, <em>LaTeX</em>, <em>troff</em>, among others, that defines the <em>structure</em> of a text, and it tells to a computer how to show it in a web page using tags embedded into the content of the document. For example, a paragraph is defined using a tag like this <p> text inside </p>, a title: <title> text inside </title>, and so on with images, tables, et cetera.

CSS is a <em>style sheet language, </em>that is<em>,</em> another kind of <em>computer language</em> whose main emphasis is the <em>appearance</em> of the web page, telling the computer the <em>presentation </em>the <em>structured document</em> is about to have, that is, <em>how the document should look</em>.

As a result, CSS is used to describe the presentation of documents written in HTML and <em>can be included</em> in it.

On the other side, <em>programming languages</em> are <em>formal languages </em>(like the ones of mathematics and logic), that is, with some rules and a particular syntax intended to "communicate instructions to a machine, particularly a computer" [Wikipedia, 2019], and some examples of high-level programming languages are those like C, Python, Fortran, Lisp, CommonLisp, Pascal, JavaScript, among many others.

7 0
3 years ago
Will Give Brainliest NEED ASAP!!!!!!!!!!!!!!!!!!!!11 Cheri's teacher asked her to write a program using the input() function. Wh
kari74 [83]

Answer:

d

Explanation:

it is an input

4 0
3 years ago
Other questions:
  • You can create a database using one of the many templates available or by creating a new ______ database.
    9·1 answer
  • How many instructions can the microprocessor execute each second if the assembly line is present?
    12·1 answer
  • Computer _____ begins with regular maintenance of the computer system such as firewalls, antivirus programs, defragmentation, de
    7·1 answer
  • What is the voltage drop across R4 in the diagram shown above?
    13·1 answer
  • Why is a memory hierarchy of different memory types used instead of only one kind of memory?
    13·1 answer
  • An effective problem statement ensures that
    12·1 answer
  • Write a paragraph on the following topic.
    14·1 answer
  • Why is information broken down into packets
    15·1 answer
  • Describe the importance of human interaction in a computing system.
    14·2 answers
  • A series of dialog boxes that guides you through creation of a form or report is called a ____.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!