Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Java Homework : Can someone explain me how the retail surcharge amount is calcul

ID: 3703234 • Letter: J

Question

Java Homework: Can someone explain me how the retail surcharge amount is calculated? I'm not understanding how they got $2.06.

Also, how would I be able to store the side effects in an array in the data definition class?

Some drugs in the catalog are considered high-risk drugs. They are considered high-risk because they may cause at least three side effects. Example side effects include upset stomach, headache, uncontrolled bleeding, etc. Each of the high-risk drugs require extra care but offer greater reward for the company. These drugs must track all of the same pieces of data as drugs that are not high-risk However, high-risk drugs must also track a list of side effects, at least three, up to 14 side effects, and a retail cost surcharge amount. The retail cost of a high-risk drug must also factor in the retail cost surcharge amount. For example, a high-risk drug with a wholesale cost of $13.50 that has been on the market for 9 years and has a retail cost surcharge amount of $2.06 will result in a retail cost of $22.85.

Explanation / Answer

Surcharge no calculated by number of years. usually surcharge is calculated on tax.

for example: 10% surcharge on 30% tax will become 33% overall tax.

As per given details the retail price is $22.85 and wholesale price $13.50

i.e the overall tax is $22.85-$13.50 = $9.35

subtracting surcharge from overall tax $9.35-$2.06=$7.29

i.e original tax is $7.29

By calculating (2.06/7.29)*100=29%(Approx)

It looks like 29% surcharge added on tax

For Tracking side effects maintain Two 2D arrays

First array

Array Drug[n][3]

n depends on number of drugs available in the company

Drug[n][0]= Name of the drug

Drug[n][1]=High-risk(yes/no)

Drug[n][2]=Address of side effects tracking(*pointers)

Example:

Name of the drug

High-risk

Adress

Drug 1

yes

*SodeEffects[1][1]

Drug2

No

---

Array Two

Will maintain Side of maximum of 14(only for high risk drugs, i.e for drugs which have yes in the first array)

Array SideEffects[n][14]

Side effect 1

Side effect2

Sede effect3

Side effect 14

Get the pointer value of the record and place it in the related row in the Drug array

Name of the drug

High-risk

Adress

Drug 1

yes

*SodeEffects[1][1]

Drug2

No

---

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote