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
WARRIOR [948]
3 years ago
14

Define a structure Triangle that contains three Point members. Write a function that computes the perimeter of a Triangle . Writ

e a program that reads the coordinates of the points, calls your function, and displays the result
Computers and Technology
1 answer:
qwelly [4]3 years ago
7 0

Answer:

The program in C++ is as follows:

#include <iostream>    

using namespace std;

int perimeter(int side1, int side2, int side3){

return side1+side2+side3;

}

struct Triangle  {

int side1;  int side2;   int side3;

};

int main(void) {

int side1, side2, side3;

cout<<"Sides of the triangle: ";

cin>>side1>>side2>>side3;

struct Triangle T;

T.side1 = side1;

T.side2 = side2;

T.side3 = side3;  

cout << "Perimeter: " << perimeter(T.side1,T.side2,T.side3) << endl;

return 0;

}

Explanation:

See attachment for complete code where comments are as explanation

Download cpp
You might be interested in
Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two
Alexeev081 [22]

Answer:

In Python:

cprice= int(input("Current price: "))

lmonth= int(input("Last month's price: "))

print("This house is $"+str(cprice))

print("The change is $"+str(cprice-lmonth)+" since last month")

print("The current mortage $"+str((cprice * 0.051) / 12)+" since last month")

Explanation:

Get current price

cprice= int(input("Current price: "))

Get last month's price

lmonth= int(input("Last month's price: "))

Print the current price

print("This house is $"+str(cprice))

Print the change

print("The change is $"+str(cprice-lmonth)+" since last month")

Print the mortgage

print("The current mortage $"+str((cprice * 0.051) / 12)+" since last month")

8 0
3 years ago
Assume that x and y are boolean variables and have been properly initialized. !(x || y) || (x || y) The result of evaluating the
LenaWriter [7]

Answer:

The answer is "Always true "

Explanation:

Following are the program to this question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

bool x=true;//defining bool variable x and assign value

bool y=false;//defining bool variable y and assign value

if(!(x || y) || (x || y))//use given condition with if block

{

   cout<<"True";//print true message

}

else//defining else block

{

   cout<<"false";//print false message

}

   return 0;

}

In the above code two bool variable is declared, that hold ture and false, and used in the given expression with the condition statement, that checks the given value. In the code the logical gate OR gate that always print the true value.

3 0
3 years ago
Al thecnology can do all the following except ​
ololo11 [35]

Answer:

D.

Explanation:

4 0
3 years ago
Guess The Song
WARRIOR [948]
The ABC’s is the song
8 0
3 years ago
Read 2 more answers
Which feature of a network intrusion prevention system (NIPS) uses a lists of known bad IP addresses to protect the network?
mario62 [17]

Answer:

Reputation based System

Explanation:

In this type of security system a file or IP address is classified as safe or unsafe based on the reputation, this can make unsafe conditions predictable and intrusion prevented with ease. it is easy to identify danger if the potential source of it is marked. This technology is usually employed by anti-virus softwares, anti-malwares, or other software systems that is used for security.

7 0
4 years ago
Other questions:
  • Which of the following Information Technology career fields generally requires the lowest level of education for an entry-level
    13·2 answers
  • Write a recursive method public static String reverse(String str) that computes the reverse of a string. For example, reverse("f
    6·1 answer
  • On your Web page, you include various links and clickable images that have the ability to trigger various functions when users c
    13·1 answer
  • What is the output of the second println statement in the main method, public class foo { int i ; static int s ; public sttic vo
    15·1 answer
  • Your friend Rebecca called because she is working on a budget and needs help with the AutoSum feature. She thinks AutoSum will b
    8·1 answer
  • What does the opacity effect do
    8·2 answers
  • The Department of Homeland Security only deals with threats to national security and does not play a role in helping companies m
    13·1 answer
  • Student aid is based on either financial need or _____ need.
    12·2 answers
  • WILL UPVOTE ALL
    10·1 answer
  • Im trying to do an animation only using simplegui in python and my objective is make the ball enters frame, be confused and jump
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!