Problem Solving with C++ (10th Edition)
Problem Solving with C++ (10th Edition)
10th Edition
ISBN: 9780134448282
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 5.1, Problem 1STE

What is the output of the following program?

  #include <iostream>

  void friendly();

  void shy(int audienceCount);

  int main()

  {

  using namespace std;

  friendly();

  shy(6);

  cout << “One more time: \n”;

  shy (2);

  friendly ();

  cout << “End of program. \n”;

  return 0;

  }

  void friendly ()

  {

  using namespace std;

  cout << “Hello \n”;

  }

  void shy(int audienceCount)

  {

  using namespace std;

  if (audienceCount < 5)

  return;

  cout << “Goodbye \n”;

  }

Blurred answer
Students have asked these similar questions
Condition ;;; 2. Cond (condition) function (defparameter *age* 18); Create variable age (defvar *college-ready* nil) ;;; cond is like if else if else (cond ((>= *age* 18); If True do this (setf *college-ready* 'yes) (format t "Ready for College ~%")) ((< *age* 18); Else If T do this (setf *college-ready* 'no) (format t "Not Ready for College ~%")) Task: Modify the above to read the age from the terminal/console and run it with age 17 and 19. e,g, What is the age? 19 Ready for College
#include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0; void calculatechange(int* change){if(*change>0){if(*change>=50){*change-=50;cent50++;}else if(*change>=20){*change-=20;cent20++;}else if(*change>=10){*change-=10;cent10++;}else if(*change>=05){*change-=05;cent05++;}calculatechange(change);}}void printchange(){if(cent50)printf("\n50cents:%d coins",cent50);if(cent20)printf("\n20cents:%d coins",cent20);if(cent10)printf("\n10cents:%d coins",cent10);if(cent05)printf("\n05cents:%d coins",cent05);cent50=0;cent20=0;cent10=0;cent05=0;}void takechange(int* change){scanf("%d",change);getchar();}int main(){int change=0;int firstinput=0;while(1){if(!firstinput){printf("\nEnter the amount:");firstinput++;}else{printf("\n\nEnter the amount to continue or Enter -1 to…
2) for both triangle and diamond, first display a triangle of requested size, and then if the choice is a diamond, add the bottom part 3) displays the shape We want to create a program that draws a diamond or a triangle with a size that the user selects using a specific character that will be entered at the keyboard. Here are two examples: To write this program, we will assume that we have the following functions: 1) void instructions() // This function describes the program and how it works A triangle of size 4, using *: 2) int menu() // This function will return a choice to the main ; 1) draw triangle, 2) draw diamond, and 3) quit *** ***** ******* 3) draw_shape(int choice) // This function calls on appropriate function depending on the choice to draw a shape A diamond of size 4, using *: 4) int get_size() // This function will return the size of the shape, same function for either of the shapes *** ***** ******* ***** 5) char get_char() // This function will ask users to select a…

Chapter 5 Solutions

Problem Solving with C++ (10th Edition)

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Control Structure in Data Structure - Data Structures - Computer Science Class 12; Author: Ekeeda;https://www.youtube.com/watch?v=9FTw2pXLhv4;License: Standard YouTube License, CC-BY