Answer:
int calculate_cost(int quantity) {
double cost = 0;
if (quantity <= 20)
cost = quantity * 23.45;
else if (quantity >= 21 && quantity <= 100)
cost = quantity * 21.11;
else if (quantity > 100)
cost = quantity * 18.75;
return cost;
}
Explanation:
Create a function called calculate_cost that takes one parameter, quantity
Initialize the cost as 0
Check the quantity using if else structure. Depending on the quantity passed, calculate the cost. For example, if the quantity is 10, the cost will be $234.5
Return the cost
Answer:
An author's qualifications are important in determining whether a media source is;
Credible
Explanation:
In order to find out about the credibility of an author, the preface, forward, and or introduction including the book's back cover should be checked for the author's credentials, qualifications and areas where the author is an expert
The author's credential can also be checked by finding out about other books the author has written and also about the author's biography.
If you’re assigned the job of writing a company newsletter or producing a product brochure, it is important to learn about that document type and review examples that are considered to have a good layout and design because:
- It ensures conformity (especially if the organization already has a pattern).
- It will aid readability.
- It will help to guarantee a result that is satisfactory to the employers.
When given the job of writing a brochure, it is important to review examples that are considered standard.
This is because it will help to ensure an excellent final result that is in harmony with the company's requirements. It will also ensure conformity to standards.
Learn more about document type here:
brainly.com/question/1218796
Answer:
0.127 miles ; 5.458 *10^8 miles
Explanation:
Number of bytes needed to store a page = 2000
Number of pages (Harry Potter's book) = 800
Total memory required to store entire book = (2000 * 800) = 1600000 = 16 * 10^5 bytes
Hence,
1 byte of memory will store : (height of each book / memory size of each book)
= 3 ÷ 16 * 10^5
= 1.875 * 10^-6
For 32 bit memory space :
(1.875 * 10^-6 * 2^32) = 8053.06368 inches
1 inch = 1.578 * 10^-5 mile
8053.06368 inches = 8053.06368 * (1.578 * 10^-5) = 0.1270773448704 miles
= 0.127 miles
For 64 bit memory size :
(1.875 * 10^-6 * (2^64)) = 3.45876 * 10^13 inches
(3.45876 * 10^13) * (1.578 * 10^-5)
= 5.458 *10^8 miles
Answer:
previousAddition instance variable
Explanation:
In order to accomplish this you would need to add a previousAddition instance variable. In this variable you would need to save the amount that was added at the end of the process. Therefore, if a mistake were to occur you can simply call the previousAddition variable which would have that amount and subtract it from the total. This would quickly reverse the mistake, and can be easily called from the undo() method.