i am curently attending college and i don't know how to start this assignment i was givin:
while spending the summer as a surveyor's assistant you decide to write a program that transforms compass headings in degrees ( 0 to 360 ) to compass bearings. using only one decimal place. if anty one can help me i would appreciate it thanks alot.

Recommended Answers

All 6 Replies

#include <iostream>
using namespace std;

int main()
   // your code here
   return 0;

And read the Announcement.

i know how to do that i need help with how i go about changing the degrees into bearings and inputing it into the program

Do you know how to do it on paper? If not then there's no way you can tell the computer how to do it. Understand the problem first, then try your hand at solving it. If (only then) you get stuck, we'll be happy to give you hints.

i need help figuring out what my constants and variables would be

>i need help figuring out what my constants and variables would be
You probably need a variable for the degrees, and a constant for the conversion ratio. If you really want to you can also use a variable for the bearings, though you probably don't need it.

Or were you expecting someone to tell you how to perform the conversion? That's what google is for.

Basically your compass bearing equals the compass heading in degrees Plus/minus the number of degrees of declination from true north for your specific location.

CB = CH +/- declination

so create appropriate variables for the required input values and output result answer
accept inputs for each of those variables
calculate the answer
output the answer
be sure to include the appropriate header files
document your code well for your instructor to be able to see at a glance what you did

good luck. this should be a cinch.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.