What is the value of i after the following loop

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

Reference list of functions/syntax:

cout <<
cin >>
getline(cin, ...) static_cast<type> (...) some_string.length() some_string.substr(m) some_string.substr(m,n) some_string[i]
left, right
setw(n) set ll('[character]') setprecision(n)
xed if (...) { ... }
else if (...) { ... } else (...) { ... } while (...) { ... }

1. One-Liners (1 mark each) Place answer in the box. Generally no partial credit.

(a)  Determine the truth of the following statement: (5 > 4) && ( (2 > 6) || !(0 > 1) )

(b)  What is the value of i after the following loop? int i = 5; while( (i % 3) != 0) { i++ ;}

2. Short Answer

Consider the class declaration below for a class that stores numbers and returns the largest/smallest in the collection.class MaxMin

{public: //  Create a new MaxMin object  MaxMin();
//  Add a double to MaxMin collection void include(double new_num);
//  Return the largest number in collection double get_max() const;
//  Return the smallest number in collection double get_min() const;
};
private:
// Stuff you don't need to worry about };

Write a few lines of code that will:

(a)  Create a new MaxMin object called MM.

(b)  Add the value 3.14 to the MM collection.

(c)  After several items have been added, write a few lines that will output "Yes" if the smallest element is less than or equal to -7 and otherwise print "No".

Assume all necessary header less and supporting les are already included, you are in the standard namespace, your code appears somewhere inside the main routine, etc. 

Reference no: EM131103655

Questions Cloud

How much will your firms total revenues : You are the manager of a firm that receives revenues of $20,000 per year from product X and $80,000 per year from product Y. The own price elasticity of demand for product X is -3, and the cross-price elasticity of demand between product Y and X is -..
Competition might reduce discrimination in the long run : Males under the age of 25 must pay far higher auto insurance premiums than females in this age group. How does this fact relate to statistical discrimination? Statistical discrimination implies that discrimination can persist indefinitely, while the ..
Which food is the most likely vehicle of infection : Using the data in the above line listing, complete the table below. Which food is the most likely vehicle of infection? What type of transmission is this (person-to-person, indirect vehicle-borne, airborne, indirect vector-borne, direct droplet sprea..
Discuss your overall fat intake and what types of fat : How did your intakes compare to the ULs (diet and any supplements combined)? Discuss. how did your intakes compare to fiber and water recommendations? Discuss. discuss your overall fat intake and what types of fat predominate in your diet. how do you..
What is the value of i after the following loop : Determine the truth of the following statement: (5 > 4) && ( (2 > 6) || !(0 > 1) ). What is the value of i after the following loop? int i = 5; while( (i % 3) != 0) { i++ ;}
What is the difference between gdp and gnp : What is the difference between GDP & GNP?
Domestic investment remained the same : if a country were to save more, but its domestic investment remained the same, then which of the following would rise
Motivations were behind increase in federal funds target : What economic circumstances and motivations led to the end of quantitative easing? Be specific. What specific motivations were behind the increase in the federal funds target?
What is the required reserve ratio : What is the required reserve ratio? if the fed increases the reserve requirement from your answer to part a to 10 percent, explain verbally and show numerically what will happen to:

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  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.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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