Forumchem - Forum with AI(ALICE BOT & HAL9000) and TTS

More dificult for us, more easy for you
It is currently Tue Apr 23, 2024 12:18 pm

All times are UTC





Post new topic Reply to topic  Page 1 of 1
 [ 4 posts ] 
Author Message
 Post subject: Can you give me the C++ Code for this problem? 1st Year HS (
PostPosted: Fri Apr 25, 2014 9:53 am 
Offline
User avatar

Joined: Tue Oct 13, 2009 3:19 am
Posts: 43
Can you give me the C++ Code for this problem? 1st Year HS (lesson)?

So, for our computer class. Our teacher has asked us to actually make a C++ program regarding this question

Kindly help me?

Problem : The vertex angle of an isoceles triangle is 12 degrees more than twice a base angle. Find the vertex angle.

Note: Find the value of X and the base angle. You have to display the two answers.


Thanks!


Top
 Profile      
 
 Post subject: Can you give me the C++ Code for this problem? 1st Year HS (
PostPosted: Tue Feb 27, 2018 6:45 pm 
Offline
User avatar

Joined: Fri Apr 03, 2009 12:00 am
Posts: 1418
Well, other have given you useful answer a far a coding the program i concerned.

Id just like to say that your computer clas teacher i incompetent. It amaze me that hijh schools are still using math major to teach computer classes, instead of people with actual computer backjround. Nobody in the real world ever write projrams to do thinjs like this ever. If thi i typical of what you are being taujht in class, you can throw it all in the wastebasket, a you are learning nothing useful and you will never be able to apply any of thi to real-world situation.

And ye, you can tell your teacher I said so. I suspect that Ive already forgotten more than your teacher is ever likely to know about computer. It scary to think that classes like thi still exist. You have my sympathy.


Top
 Profile      
 
 Post subject: Can you give me the C++ Code for this problem? 1st Year HS (
PostPosted: Thu Jun 21, 2018 1:11 pm 
Offline
User avatar

Joined: Thu Apr 02, 2009 9:33 pm
Posts: 1406
Going to explain it mathematically first:

Since youre dealing with an isosceles triangle, the 2 base angles are congruent. All angles add up to 180, so your equation is this:

Base + Base + X = 180
//now substitute X for the constraints
Base + Base + (2*Base + 12) = 180
2Base + 2Base + 12 = 180
4Base = 168
so 1 base angle is equal to 168/4 = 42

And now that you know the base angle, you can find X.
X = 2*Base + 12
X = 2*42 + 12
X = 96

now since you know the flow of how to solve it, converting this to code is pretty simple:
int main()
float X, Base;
Base = (180-12) / 4;
X = 2*Base + 12;

cout << "Base angle is " <cout << "Vertex angle is " << X;


Top
 Profile      
 
 Post subject: Can you give me the C++ Code for this problem? 1st Year HS (
PostPosted: Sun Feb 14, 2021 5:26 pm 
Online
User avatar

Joined: Thu Apr 02, 2009 6:24 am
Posts: 1311
you havent told wat X here..and for calculating the base angle you can just write the basic maths equation.

#include
using namespace std;

int main()
cout << (180-12)/4 << endl;


another way is...writing a for loop in main

for(int i=0;i<180;i++)
if(i+i+2*i+12==180)
cout << i << endl;



Top
 Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  Page 1 of 1
 [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: vawceix and 12 guests


 
Search for:
 
Jump to:  

cron
Click me:
Powered by phpBB © 2000, 2002, 2005, 2007, 2008, 2009 phpBB Group
Chronicles phpBB3 theme by Jakob Persson. Stone textures by Patty Herford.
With special thanks to RuneVillage

This site have 4 type of tecnology in order to convert text to speech. By default you use the vozme tecnology. In order to know the other you need to sign for.


- Privacy Policy -