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
timama [110]
3 years ago
5

Which statement allows you to properly check the char variable code to determine whether it is equal to a "C" and then output "T

his is a check" and then advance to a new line?
(A) If code is equal to Y



cout < < 'This is a check\n":



(B) If (code = "Y")



cout < < 'This is a check" < < endl:



(C) If (code == 'Y')



cout < < 'This is a check\n":



(D) If (code == Y)



cout < < 'This is a check" < < endl:
Engineering
1 answer:
olasank [31]3 years ago
7 0

Answer:

if (code == 'Y')

  cout << "This is a check\n";

Explanation:

I believe you want to check whether it is equal to "Y", because there is no option that checks "C". You may see the correct structure above, none of the option you provided is totally correct.

In order to check the character, we need to use if statement. Also, since "Y" is a character, we need to use ' ' not " ".

To output "This is a check", we need to use cout. The string should be inside " " not ' ' or ' ".

To have a new line, we may use \n. At the end, we need to use ; not :

You might be interested in
Why are you asked to draw a sketch of a Bridge-Design on a graph sheet/A4 sheet?
elena-s [515]

Engineers or architects can be asked to draw a sketch of a bridge-design on a graph sheet or A4 paper to communicate their ideas and scale their drawings.

Architectural sketches are about the communication of ideas. Engineers and architects use hand sketching to clarify elements of the design to the contractor or client.

It should be noted that drawings can also be drawn on a graph sheet or A4 paper to represent the detail before it's eventually constructed.

Scale drawings are used for the illustration of items that are not convenient to draw their actual size. In the construction industry, scales are used depending on the nature of the drawing. Drawings can be made on a graph or A4 paper due to the ease of printing, reproducing, and resizing the drawings.

Read related link on:

brainly.com/question/20689874

4 0
3 years ago
Read 2 more answers
a piping system has an internal air pressure of 1,500 kpa. In addition to being subject to the air pressure, the piping supports
Alik [6]

Answer:

See explaination

Explanation:

please kindly see attachment for the step by step solution of the given problem.

5 0
4 years ago
A differential amplifier is to have a voltage gain of 100. What will be the feedback resistance required if the input resistance
yuradex [85]

Answer:

required feedback resistance ( R2 ) = 100 k Ω

Explanation:

Given data :

Voltage gain = 100

input resistance ( R1 ) = 1 k ohms

calculate feedback resistance required

voltage gain of differential amplifier

\frac{Vout}{V2 - V1 }  = \frac{R2}{R1}

= Voltage gain =  R2/R1

= 100 = R2/1

hence required feedback resistance ( R2 ) = 100 k Ω

4 0
3 years ago
This method will sell the seat in row i and column j unless it is already sold. A ticket is sold if the price of that seat in th
blsea [12.9K]

Answer:

The solution code is written in Java.

  1. public class Movie {
  2.    private double  [][] seats = new double[5][5];
  3.    private double totalSales;
  4.    public Movie(){
  5.        for(int i= 0; i < this.seats.length; i++){
  6.            for(int j = 0; j < this.seats[i].length; j++){
  7.                this.seats[i][j] = 12;
  8.            }
  9.        }
  10.        this.totalSales = 0;
  11.    }
  12.    public boolean bookSeat(int i, int j)
  13.    {
  14.        if(this.seats[i][j] != 0){
  15.            this.totalSales += this.seats[i][j];
  16.            this.seats[i][j] = 0;
  17.            return true;
  18.        }else{
  19.            return false;
  20.        }
  21.    }
  22. }

Explanation:

The method, bookSeat(), as required by the question is presented from Line 16 - 26 as part of the public method in a class <em>Movie</em>.  This method take row,<em> i</em>, and column,<em> j</em>, as input.

By presuming the seats is an two-dimensional array with all its elements are  initialized 12 (Line 7 - 10). This means we presume the movie ticket price for all the seats are $12, for simplicity.

When the<em> bookSeat() </em>method is invoked, it will check if the current price of seats at row-i and column-i is 0. If not, the current price, will be added to the <em>totalSales </em>(Line 19)<em> </em>and then set the price to 0 (Line 20) and return <em>true</em> since the ticket is successfully sold (Line 21).  If it has already been sold, return <em>false</em> (Line 23).

8 0
4 years ago
Comparison of density values determines whether an item will float or sink in water. For each of the values below, determine the
geniusboy [140]

Answer:

a) the object floats

b) the object floats

c) the object sinks

Explanation:

when an object is less dense than in the fluid in which it is immersed, it will float due to its weight and volume characteristics, so to solve this problem we must find the mass and volume of each object in order to calculate the density and compare it with that of water

a)

volumen for a cube

V=L^3

L=1.53in=0.0388m

V=0.0388 ^3=5.8691x10^-5m^3=58.69ml

density=m/v

density=13.5g/58.69ml=0.23 g/ml

The wooden block floats  because it is less dense than water

b)

m=111mg=0.111g

density=m/v

density=0.111g/0.296ml=0.375g/ml

the metal paperclip floats   because it is less dense than water

c)

V=0.93cups=220.0271ml

m=0.88lb=399.1613g

Density=m/v

density=399.1613/220.027ml=1.8141g/ml

the apple sinks   because it is  denser than water

4 0
4 years ago
Other questions:
  • 25 points!!
    13·1 answer
  • _______is defined as the use of statistical techniques to control a process or production method
    13·1 answer
  • 2. Controlled-access highways permit traffic to enter them only from
    8·1 answer
  • Air at 80 kPa and 10°C enters an adiabatic diffuser steadily with a velocity of 150 m/s and leaves with a low velocity at a pre
    11·1 answer
  • The input to a harmonic generator is a periodic waveform v(t) = Ce^-alpha t, 0 &lt; t &lt; 1, T = 1 with alpha &lt; 0. The outpu
    6·1 answer
  • Since the application can be the prospective employers first impression, it is important to a. always answer questions truthfull
    5·2 answers
  • Sewage is being treated in two aerated lagoons in series. Each lagoon has a surface area of 5 hectares (ha) and depth of 1 m, an
    12·1 answer
  • What is the differences between total revenue and total costs? Make
    6·1 answer
  • Can somebody help me
    9·1 answer
  • From the top of a vertical cliff 80m high, the angles of depression of 2 buoys lying due west of the cliff are 23° and 15° respe
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!