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
Bingel [31]
3 years ago
6

Assume that an int variable is Quadrilateral has been declared, and that another int variable, number Of Sides has been declared

and initialized. Write a statement that assigns the value 1 if number Of Sides is exactly 4 and 0 otherwise.
Computers and Technology
1 answer:
kondor19780726 [428]3 years ago
4 0

Answer:

The answer to this question can be given as:

Statement:

isQuadrilateral = (numberOfSides == 4) ? 1 : 0;

//check condition using ternary operator.

Explanation:

we know that both(Quadrilateral, numberOfSides) is already declared in the program. So the statement for check condition is (isQuadrilateral = (numberOfSides == 4) ? 1 : 0;). To check this condition we use the ternary operator. In this operator, we also check another condition. The syntax of ternary operator (condition ? value_if_true : value_if_false).In this statement on the lift side we use the variable for check condition and right side we check condition if the value is true it prints 1 else it will print 0.

You might be interested in
i got a set of headphones and when i plug them into my speakers the right side only works how do i fix the left side of them
Sladkaya [172]
Sorry I don't know what is wrong with your headphones. Maybe try plugging them into something else.
3 0
3 years ago
Programming CRe-type the code and fix any errors. The code should convert non-positive numbers to 1.
LUCKY_DIMON [66]

Answer:

Given

The above lines of code

Required

Rearrange.

The code is re-arrange d as follows;.

#include<iostream>

int main()

{

int userNum;

scanf("%d", &userNum);

if (userNum > 0)

{

printf("Positive.\n");

}

else

{

printf("Non-positive, converting to 1.\n");

userNum = 1;

printf("Final: %d\n", userNum);

}

return 0;

}

When rearranging lines of codes. one has to be mindful of the programming language, the syntax of the language and control structures in the code;

One should take note of the variable declarations and usage

See attachment for .cpp file

Download cpp
5 0
4 years ago
A(n) _____ chart is drawn on the same worksheet as the data.
svet-max [94.6K]
A is the answer because it makes more sense.............
5 0
3 years ago
1. What cause cable problems? How can these problems be solved?
lukranit [14]

Explanation:

Ageing.

Wrong selection or application.

Mechanical failures.

Corrosion of sheath.

Moisture in the insulation.

Heating of cable.

Fire and lightning surges.

Electrical puncture.

This is the only thing I know that causes cable problems, sorry if it couldn't help you!

4 0
3 years ago
What kind of resources can we share over the network? Plzzzzzzzz help!!!!!!
lubasha [3.4K]

Sharing network resources requires abiding by certain constraints, as follows:

<span>Security: Organizations present ongoing opportunities for unauthorized shared resources. Security mechanisms should be implemented to provide efficient parameters.Compatibility: Various client-server operating systems may be installed, but the client must have a compatible OS or application to access shared resources. Otherwise, the client may encounter issues that create communication delays and requires troubleshooting.Mapping: Any shared OS hardware drive, file or resource may be accessed via mapping, which requires a shared destination address and naming conventions.<span>File Transfer Protocol (FTP) and File Sharing: FTP is not affected by shared resources because the Internet is FTP’s backbone. File sharing is an LAN concept.</span></span>
3 0
4 years ago
Read 2 more answers
Other questions:
  • What symbol following a menu command lets you know that a dialog box will be displayed?
    14·1 answer
  • The following function open_file() opens a file called 'example.txt' and returns the file pointer. This function is called withi
    12·1 answer
  • What is the maximum number of columns in a spreadsheet that you can sort in one instance in software like OpenOffice Calc?
    7·2 answers
  • Write a program named Admission for a college’s admissions office. The user enters a numeric high school grade point average (fo
    15·1 answer
  • What is computer hacking? describe some examples
    6·1 answer
  • The algorithm ADDN implements N-bit fixed-width binary addition for non-negative integers and ignores overflows. For example, AD
    13·1 answer
  • HELP ME FAST???
    15·1 answer
  • How are a normal video updater and a 3-D graphics updater Alike? how are they different?
    14·1 answer
  • Hey, My paperclips just stoped producing, does anyone have any idea how to start them up again?
    5·1 answer
  • What is an example of new technology having a negative impact on sustainability?.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!