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
Svetllana [295]
3 years ago
9

3.14 LAB: Input and formatted output: Caffeine levels A half-life is the amount of time it takes for a substance or entity to fa

ll to half its original value. Caffeine has a half-life of about 6 hours in humans. Given caffeine amount (in mg) as input, output the caffeine level after 6, 12, and 24 hours. Use a string formatting expression with conversion specifiers to output the caffeine amount as floating-point numbers.
Computers and Technology
1 answer:
nata0808 [166]3 years ago
8 0

Answer:

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

double caffeineMg;

cin>>caffeineMg;

cout<<"After 6 hours: "<<fixed<<setprecision(2)<<caffeineMg/2.0<<" mg\n";

cout<<"After 12 hours: "<<fixed<<setprecision(2)<<caffeineMg/4.0<<" mg\n";

cout<<"After 24 hours: "<<fixed<<setprecision(2)<<caffeineMg/8.0<<" mg\n";

return 0;

}

Explanation:

  • Declare a variable for caffeine and take the input from user.  
  • Print the results by dividing the caffeine by relevant Half Life.
  • Use setprecision function to display the result up to 2 decimal places.
You might be interested in
______ is the software that blocks a user from being able to access your computer.
antiseptic1488 [7]
The answer is firewall. It is a network security device that observes inbound and outbound network traffic and chooses whether to allow or block specific traffic based on a well-defined set of security rules. Firewalls have been a first line of protection in network security for over 25 years. The firewall present a barrier between measured and secured internal networks that can be trusted and untrusted outside networks, for example the Internet. A firewall can be software, hardware, or even both.
8 0
3 years ago
For each of the following application areas state whether or not the tree data structure appears to be a good fit for use as a s
Cerrena [4.2K]

Answer:

a) Chess game moves:- Tree data structure is not a good fit.

b) Public transportation paths:- Tree data structure is not a good fit.

c) Relationshi[p among computer files and folders:- Tree data structure is a good fit.

d) Genealogical information:- Tree data structure is a good fit.

e) Parts of books:- Tree data structure is a good fit.

f) Programming language history:- Tree data structure is not a good fit.

g) Mathematical expression:- Tree data structure is a good fit.

Explanation:

a) Chess game moves:- Tree data structure is not a good fit. Since in tree data structure moving backward or sharing the node is not that much easy. Presume, In chess, you have to check any box is empty or not. Here, Graph is the best fit.

b) Public transportation paths:- Tree data structure is not a good fit. whenever shortest path, routes, broadcast come always graph is a good option. Because in the tree you don't know how many time you visit that node

c) Relationshi[p among computer files and folders:- Tree data structure is a good fit. Since they have a predefined route. Go to 'c' drive. Open a particular folder and open a particular file.

d) Genealogical information:- Tree data structure is a good fit. Since genealogical information also has a predefined route. Here, the Graph is not suitable.

e) Parts of books:- Tree data structure is a good fit. Since manages the chapters and topics are not that much complex. You can see any book index which is in a very pretty format.

f) Programming language history:- Tree data structure is not a good fit. To store the history of the programming language we need some unconditional jumps that's why the tree is not suitable.

g) Mathematical expression:- Tree data structure is a good fit. The tree is suitable in some cases. We have an expression tree for postfix, prefix.

5 0
3 years ago
In the SQL environment, a _____________ is a logical group of database objects – such as tables and indexes – that are related t
Paha777 [63]

Answer:Schema

Explanation: A schema is the group that contains objects of databases with views, index, triggers, tables etc features. The specific user can access schema who persist a certain username.The user is considered as the owner of the database and its element.

Schema is usually bound to have only single database.There are some schema that are already present in the system as the in-built schema .E.g.- sys, guest etc.

5 0
3 years ago
David needs to create a password. He uses "rtjjkliusfvwr." Which of the following best explains the weakness in his password?
Darina [25.2K]
I would say because it is hard to remember. Unless each one of those stands for a world, kind of like an acronym, then good luck remembering it!
3 0
3 years ago
Read 2 more answers
Draw a flowchart or write pseudocode to represent the logic of a program that allows the use to enter values for the width and l
DIA [1.3K]
In psuedocode it would be:

length = input()
width = input()

area = length * width

print(area + " sq ft");

3 0
3 years ago
Other questions:
  • Write a program that determines a student's letter grade. Allow the user to enter three test scores. The maximum score on each t
    9·1 answer
  • Sophie Black works as a computer programmer for a software company. Her boss, Mike Jones, is responsible for developing a new so
    8·1 answer
  • Company policies require that all network infrastructure devices send system level information to a centralized server. Which of
    6·1 answer
  • How many check boxes from the following code can be selected at any given time? Home Address Federal Express UPS
    13·1 answer
  • Which of these is a requirement for developing game applications on devices running Apple’s iOS operating system?
    6·2 answers
  • An equation that performs a calculation is a formula. True or false quest
    9·1 answer
  • A prime number is an integer that is divisible only by 1 and by itself. Write a program that: 1. Takes a number as an input. 2.
    5·1 answer
  • In which table is the input and the corresponding output of a Boolean function listed? How is the output of the NAND gate determ
    9·1 answer
  • You are working with an online tech service to fix a problem with installation of a program on your machine. You grant them remo
    13·1 answer
  • Read the introduction (paragraphs 1-3].
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!