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.
Answer:
Explanation:
The code for the given problem is written below
.data
A : .word 1 2 3 4 5 6 7 8 9 10
.text
la $s5,A
li $s1,0 # load g
li $s2,10 # load h
li $s3,0 # load i
li $s4,1 # load j
loop:
mul $s6,$s3,4
add $s6,$s6,$s5 #address of A[i]
lw $s6,($s6) #get value of A[i] in s3
add $s1,$s1,$s6 #g = g+A[i]
add $s3,$s3,$s4 # i = i+j
bne $s3,$s2,loop #if i!=h jump to loop
Answer:
A computer is an electronic device that manipulates information, or data. It has the ability to store, retrieve, and process data. You may already know that you can use a computer to type documents, send email, play games, and browse the Web
Explanation:
Follow me..............
Most frames use crux and I can only do a couple