Mark the following statements as valid or invalid

Assignment Help C/C++ Programming
Reference no: EM13339813

Consider the following statements:

class yClass

class xClass: public yClass

{

{

public:

public:

void one();

void one();

void two(int, int);

xClass();

yClass();

private:

private:

int z;

int a;

};

int b;

 

};

 

Suppose the following statements are in a user program (client code):

yClass y;

xClass x;

a. The private members of yClass are public members of xClass. True or False?

b. Mark the following statements as valid or invalid. If a statement is invalid, explain why.

i. void yClass::one()

{

cout << a + b << endl;

}

ii. y.a = 15;

x.b = 30;

iii. void xClass::one()

{

a = 10;

b = 15;

z = 30;

cout << a + b + z << endl;

}

iv. cout << y.a << " " << y.b << " " << x.z << endl;

Reference no: EM13339813

Questions Cloud

Find the gauge pressure inside such a bulb when it is hot : Suppose a gas-filled incandescent light bulb is manufactured to have atmospheric pressure in it at 20.0°C. Find the gauge pressure inside such a bulb when it is hot
Determine what is the mass of the wire : The tension on a wire is 2740 N. The wire is 2.6 m long and the fundamental frequency is 370 Hz. What is the mass of the wire
What is the force f2 that the larger piston could support : A small piston with area A1 = 45 cm^2 acts in a cylinder to lift a larger piston A2 = 550 cm^2 Find the force on the small piston (F1) if the pressure in the system is 7000 pascals.
Determine the temperature of the blood : Blood can carry excess energy from the interior to the surface of the body, where the energy is dispersed in a number of ways. determine the temperature of the blood
Mark the following statements as valid or invalid : Mark the following statements as valid or invalid. If a statement is invalid, explain why.
What is the depth of the flow in the channel during periods : Due to concerns about the salt water content in the estuary, the discharge in the channel needs to be varied to mimic tidal effects. This means that for 12 hours a day, the channel needs to carry a flow of 8m3.s1, and for the other 12 hours the fl..
Write a c++ statement that multiplies the value : Write a program that prompts the user to input a decimal number and outputs the number rounded to the nearest integer.
How much work is done by the electric field as third charge : how much work is done by the electric field as a third charge q3 = +2.19 nC is moved from point a to point b. (q1 = +9.41 nC, q2 = -9.41 nC)
Derive drag coefficient for f14 at max thrust and airspeed : Wingspan 64 m spread, 38 m swept Total Wing area Aw = 54.5 m2 Drag profile area Ap = 11.5 m2 Mass 27,700 kg fully loaded 2 x GE F110 Turbofan engines Thrust 61.4 kN from each engine

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Design a deck plan space ship in eclipse

Develop a simple interactive two-dimensional spaceship deck plan editor using OpenGL and GLUT. Your program will enable a user to create and save a deck plan of a hypothetical spaceship comprising the hull walls.

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  The initial data structure with information about a service

Implement a program using function for a defined task. Initial data is read from a file and added from keyboard. Program has to output initial and resulting data.The initial data structure with information about a service:

  Discuss the differences concerning how a program would acces

Discuss the differences concerning how a program would access the members of objects that have been declared as an array of objects

  Program that calculates how much a person earns in a month

Write a program that calculates how much a person earns in a month if the salary is one penny the first day, two pennies the second day, four pennies the third day,

  Write a c++ program to first find ''n'' fibonacci numbers

Write a C++ program to first find 'N' Fibonacci numbers and then display only the "even" Fibonacci numbers in "descending order" as output.

  Give a recursive definition of s.

Let S be the set of positive integers that can be written as a sum of one or more 4's and/or 7's. For example, 7 ? S and 18 ? S (because 18 = 4 + 7 + 7)

  Compares the number of possible sequences

A c++ program that compares the number of possible sequences of the length L that can be generated uinder the following assumptions. Given an alphabet of size N=9. The program must output a formatted list comparing the number of possible sequences..

  Write a script that creates a craps game

Write a script that creates a craps game and meets the following requirements. Name the script craps.sh The script will get 2 random numbers between 1-6.

  Develop a program that when you pipe in a file

develop a program that when you pipe in a file it will demonstrate on the left had side the line number  work by having a program piped in and when a \n occurs a new line and number is indicated.

  Integer arguments representing feet

A constructor that will take a single integer argument representing a whole number of feet • A constructor that will take two integer arguments representing feet and inches respectively • A constructor that will take three integer arguments represent..

  C++ class that has a dynamic array of a string

show  an example of a C++ Class that has a dynamic array of a string that takes in names by user input??

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd