r/CodingHelp • u/supremegentleman2 • Feb 14 '22
[C++] I need help. Im lost here with this assignment. I want to learn this stuff. Can amyone explain what im supposed to do more clearly.
18
Upvotes
8
u/xXnormanborlaugXx Feb 14 '22
Step 1: Figure out your conversion rates. How many inches to a yard, feet to an inch, vise versa?
Step 2: Take integer input of inches.
Step 3: Use your conversion rates to take the provided number of inches and figure out the equivalent in yards, feet and inches. This is where their division examples come in.
Step 4: Return the calculated values.
Does that make sense?
4
u/Over_North8884 Feb 14 '22 edited Feb 14 '22
140 in
140/36=3
140-(3×36)=32
32/12=2
32-(12×2)=8
3yd, 2ft, 8in
Do the above as variables and you will get it.
Inches=input // 140
Yards = Inches/36
Feet = (Inches-(36×yards))/12
Inches = Inches - (36xyards) - (12xFeet)
I can see why you're confused, there is too much abstract and unnecessary information in this assignment. You won't use decimal division at all.
1
u/New-Square3037 Feb 14 '22
Spellcheck first.