Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1056853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:46:35+00:00 2026-05-16T17:46:35+00:00

I am taking a C programming class this semester, and was somehow allowed to

  • 0

I am taking a C programming class this semester, and was somehow allowed to register despite not fulfilling the prerequisite. I thought I would still be able to handle it, but now that I have passed the point of no return for dropping it, I find myself completely lost.

For my current assignment, I am supposed to create a program that does a few simple trig operations and display the results. The main idea is that there is a building, and I am standing a certain distance from it.

For part A, I have to calculate the height of the building assuming I am standing 120 meters from the building and am looking at the top while tilting my head at a 30 degree angle (plus/minus 3 degrees).

Part B, assumes the building is 200ft tall, and I am standing 20ft away. What would be the angle I would have to tilt my head to see the top?

Part C, given the info in part B, how far is the distance (hypotenuse) from my head to the top of the building?

So far, I have written this:

    #include <stdio.h> 
    #include <math.h>
    #define MAX_ANGLE 33
    #define MIN_ANGLE 27
    #define DIST_A 120
    #define DIST_B 20
    #define HEIGHT_B 200
    #define PI 3.14159

    int main()
    (

    double MIN_ANGLE_R, MAX_ANGLE_R;

 MIN_ANGLE_R = MIN_ANGLE * (PI / 180);
 MAX_ANGLE_R = MAX_ANGLE * (PI / 180);
 min_height = DIST_A * tan(MIN_ANGLE);
 max_height = DIST_A * tan(MAX_ANGLE);
 angle = atan(HEIGHT_B/DIST_B)/(PI/180);
 hypotenuse = HEIGHT_B/tan(angle);

 printf ("The minimum height is %6.2f meters.\nThe maximum height is%6.2f meters.\n\n",min_height,max_height);
 printf ("The angle that youw ill tilt your head to see\nthe top of the building is %3.2f feet.\n",angle);
 printf ("The distance from your head to the top of the building is %6.2f feet.\n",hypotenuse);

 return 0;
)

When I try compiling the program, I keep getting errors that I don’t know how to read. IF anyone could read through my program, and tell me what’s missing, it would be a huge help.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:46:36+00:00Added an answer on May 16, 2026 at 5:46 pm
    1. Don’t confuse () and {}. They mean different things.
    2. Declare your variables.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have experience programming in C#, but I'm taking a C++ class this semester,
I am taking an undergraduate operating systems class next semester and this is a
I am taking this crazy class on Moble Programming. We have to do a
I am only allowed to use private members in the programming course I'm taking,
I am currently taking a Programming Fundamentals college class that deals with the C
This past semester I took intro to object oriented programming in java and next
I'm currently taking a class on programming the iPhone, and I am struggling with
I'm a programming student, and I've now had two classes in C#, this semester
I am taking a programming class and we are required to use the gcc
I am taking a class in C++ programming and the professor told us that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.