1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
iragen [17]
1 year ago
11

Given class triangle (in files triangle.h and triangle.cpp), complete main() to read and set the base and height of triangle1 an

d of triangle2, determine which triangle's area is larger, and output that triangle's info, making use of triangle's relevant member functions.
ex: if the input is:
3.0 4.0
4.0 5.0
where 3.0 is triangle1's base, 4.0 is triangle1's height, 4.0 is triangle2's base, and 5.0 is triangle2's height, the output is:
triangle with larger area:
base: 4.00
height: 5.00
area: 10.00
given (in main.cpp):
#include
#include "triangle.h"
using namespace std;
int main(int argc, const char* argv[]) {
triangle triangle1;
triangle triangle2;
// todo: read and set base and height for triangle1 (use setbase() and setheight())
// todo: read and set base and height for triangle2 (use setbase() and setheight())
// todo: determine larger triangle (use getarea())
cout << "triangle with larger area:" << endl;
// todo: output larger triangle's info (use printinfo())
return 0;
}
Computers and Technology
1 answer:
kow [346]1 year ago
3 0

The C++ program that would complete the main () and set the base and height of triangle1 and of triangle2 is:

main.cpp

#include <iostream>

#include "Triangle.h"

using namespace std;

int main()

{

   Triangle Tri1;  

Triangle Tri2;

   double base1, height1, base2, height2;

   cout << "Enter a base for your Triangle1: ";

   cin >> base1;

   cout << "Enter a height for your Triangle1: ";

   cin >> height1;

   cout << endl;

   cout << "Enter a base for your Triangle2: ";

   cin >> base2;

   cout << "Enter a height for your Triangle2: ";

   cin >> height2;

   cout << endl;

   

   cout << "################################" << endl;

   

   cout << "Triangle with larger area:" << endl;

   if ((0.5)*base1*height1 > (0.5)*base2*height2){

      Tri1.setValues(base1, height1);

      Tri1.getValues();

      cout << "Area: " << Tri1.getArea() << endl << endl;

}

else{

 Tri2.setValues(base2, height2);

 Tri2.getValues();

    cout << "Area: " << Tri2.getArea() << endl;

}

   

   return 0;

}

Read more about C++ programs here:

brainly.com/question/20339175

#SPJ1

You might be interested in
What else can Xbox do to help reduce negative online behavior? (250 minimum)
geniusboy [140]
Have a report button
6 0
3 years ago
Mr. Lee wants to show his class a presentation. Which device will display an enlarged view of his presentation?
Gnesinka [82]
A projector would make his presentation bigger.<span />
3 0
3 years ago
What is Digital Access, and why is it important for YOUR generation?
Harman [31]

“Our students were born with a mouse in their hands. The pervasive nature of digital culture has altered the way they think, and the way they learn. Education today is completely out of sync with this new reality.” an excerpt from Understanding the Digital Generation. The New ConnectionsThis eye-opening presentation provides a comprehensive look at how the pervasive nature of digital culture has and continues to change the brains of our students. As a result of these changes, they have developed learning styles and preferences which are in contrast to the traditional pedagogical approach. The New Connections provides a clear description of 10 core learning attributes of digital learners, and a pragmatic look at how we can teach effectively in an age when new technologies cascade onto the new digital landscape at an astonishing rate. Because of digital bombardment and the emergence of the new digital landscape, today’s youth process information, interact and communicate in fundamentally different ways than any previous generation before them. Meanwhile, many of us, having grown up in a relatively low-tech, stable, and predictable world, are constantly struggling with the speed of change, technological innovation, and the freedom to access the overwhelming sea of information online—all defining characteristics of the digital world of both today, and the swiftly-approaching future. Strategies That Work provides a comprehensive profile of several core learning attributes of digital learners, and the core teaching, learning, and assessment strategies that can be used to appeal to their digital lifestyle and learning preferences. You’ll gain a clear understanding of various research-based strategies to optimize learning for the digital generation in the new digital landscape.

7 0
3 years ago
Which country has the most common features of analogue and digital computer​
ANTONII [103]

Explanation:

i don't think rhis question could be..

4 0
3 years ago
Match the feature to the network architecture,
pochemuha

Answer:

Answer is:  

Client-Server Network

  • expensive to set up
  • has a central server
  • easy to track files
  • useful for a large organization

Peer-to-peer Network

  • useful for a small organization
  • difficult to track files
  • inexpensive to set up
  • does not have a central server

Explanation:

<em>Client-Server Network is ideal for bigger network set up like offices and companies where there will be a central server involved with several clients to access and connected with the server. This is the normal network set up to companies. While, Peer to peer network is ideal for much smaller network, which consists of only two computers to communicate and share files. This network is normally temporary and inexpensive since in only works with two computers.</em>

7 0
3 years ago
Other questions:
  • Instructions:Select the correct answer.
    13·1 answer
  • A ________ -tier design includes a middle layer between the client and server that processes the client requests and translates
    11·1 answer
  • Consider the most important item among all the categories of information stored on your personal computer. As it applies to that
    8·1 answer
  • Is downloading like installing?
    13·1 answer
  • What is unique about the TODAY and NOW functions?
    15·2 answers
  • Which is the most common way to install memory in a laptop?
    14·1 answer
  • Compared with a star topology, a hierarchical topology: a. is more effective at handling heavy but short bursts of traffic. b. a
    13·1 answer
  • Please help me on this please i am giving all of my points so please help me
    6·1 answer
  • Q1) write a brief note on desktop computer.
    13·1 answer
  • If a robot is able to change its own trajectory as per the external conditions, then the robot is considered as the__.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!