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
What is TCP/IP's Transport layer's primary duty?
lorasvet [3.4K]

Answer:

 The TCP/IP is the transmission control protocol and internet protocol and in the TCP/IP model the transport layer is the second layer.

The primary responsibility of this layer is that it is basically used to deliver messages to the host and that is why it is known as end to end layer.

It basically provide the point to point connection between the destination to server host for delivering the various types of the services efficiently and reliably.

In the TCP/IP model the transport layer are basically responsible for transferring the data or service error free between the server to destination host.

3 0
4 years ago
Alicia is a dietitian. She gives other people suggestions for nutrition. She wants to organize a large amount of data concerning
stepladder [879]
A.word processor
------------------------

5 0
4 years ago
Read 2 more answers
How could each of the two-proposed changes decrease the size of an mips assembly program? On the other hand, how could the propo
Phoenix [80]

Based on the question attached, the Number of bits that is needed to address a register is 7 bits.

<h3>3.  How could the proposed change increase the size of an mips assembly program?</h3>

The two-proposed changes decrease the size of an mips assembly program because a lot of complicated operations will need to be put in place or implemented in one instructions instead of numerous instructions due to the lowered register leaking issue. The program's size will be therefore be lowered as a result of this issue.

The proposed change will increase the size of an mips assembly program because  The size of the instruction word will then be brought up or raised if the required bits are added to the opcode and that of the register fields, which will bring up the size of the programmed.

In  the MIPS register file;

The Number of MIPS registers = 128

The Number of bits needed = log₂128

The  Number of bits needed = 7 bits

So Increasing number bits for opcode will be = (6 + 2)

                                                                       = 8

Therefore the answers to question one:

1. R-type instruction

Op-code = 6 bits

rs = 5 bits

rt = 5 bits

rd = 5 bits

shamt = 5 bits

funct = 6 bits

Hence, the size of the opcode field will be go up by two bits, to eight bits and the size of the rs ,rt, and rd fields is also go up to 7 bits.

For question 2 which is I-type instruction, there is:

Op-code = 6 bits

rs = 5 bits

rt = 5 bits

Immediate = 16 bits

Hence, The size of the opcode field will also go up by two bits, to eight bits and the size of the rs, rt  fields will is also go up to 7 bits.

Therefore, Based on the question attached, the Number of bits that is needed to address a register is 7 bits.

Learn more about program from

brainly.com/question/14897427

#SPJ1

See full question below

Assume that we would like to expand the MIPS register file to 128 registers and expand the instruction set to contain four times as many instructions. 1. How this would this affect the size of each of the bit fields in the R-type instructions? 2. How this would this affect the size of each of the bit fields in the I-type instructions? 3. How could each of the two proposed changes decrease the size of an MIPS assembly program? On the other hand, how could the proposed change increase the size of an MIPS assembly program?

6 0
2 years ago
True or False
OverLord2011 [107]

Answer:False

Explanation:

7 0
3 years ago
A museum is evaluating historical documents for authenticity, reviewing their physical condition, and categorizing them by subje
ZanzabumX [31]

Answer:

Option C

Explanation:

The museum authority can easily automate the process of storage of data on cloud once the document is prepared.

This shall help is easy access to data to all and will also prevent issues arising because of non storage of data or some form of mis-happening leading to data loss.

3 0
3 years ago
Other questions:
  • Business ethics are?
    9·1 answer
  • Kylie has created some code designed to keep track of information about employees at a company. The code will be used by the com
    6·1 answer
  • Using the FAFSA form , you can for apply for what
    14·2 answers
  • You are using a new release of an application software package. You think that you have discovered a bug. Outline the approach t
    14·1 answer
  • Write a C function check(x, y, n) that returns 1 if both x and y fall between 0 and n-1 inclusive. The function should return 0
    6·1 answer
  • The Electronic Communications Privacy Act requires an investigator to have a wiretap order to acquire ___________ information fr
    8·1 answer
  • Assume the existence of a BankAccount class with a constructor that accepts two parameters: a string for the account holder's na
    14·1 answer
  • Write a program that calculates the average of 4 temperatures. Function 1--write a function to ask a user for 4 temperatures and
    10·1 answer
  • What is destination email address​
    8·1 answer
  • Part B How could installing new technology, such as scrubber machines, affect the factories required to install them? Name a pos
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!