answer.
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
abruzzese [7]
1 year ago
14

3.34 LAB: Mad Lib - loops in C++

Computers and Technology
1 answer:
Ganezh [65]1 year ago
7 0

Answer:

A Program was written to carry out some set activities. below is the code program in C++ in the explanation section

Explanation:

Solution

CODE

#include <iostream>

using namespace std;

int main() {

string name; // variables

int number;

cin >> name >> number; // taking user input

while(number != 0)

{

// printing output

cout << "Eating " << number << " " << name << " a day keeps the doctor away." << endl;

// taking user input again

cin >> name >> number;

}

}

Note: Kindly find an attached copy of the compiled program output to this question.

You might be interested in
The elements in a string type array will be initialized to ____.?
ivanzaharov [21]
The elements in a string type array will be initialized to "Null".
7 0
2 years ago
3. Megan and her brother Marco have a side business where they shop at flea markets, garage sales, and estate
Neko [114]

Answer:

a

Explanation:

Megan doesn't have a registered business. She can't claim insurance

4 0
1 year ago
Marco makes $65,000 a year as a graphic designer. He makes a charitable donation of $1,000 each year. He also has $5,000 of busi
iogann1982 [59]
The correct answer is $59,000. 
5 0
1 year ago
Read 2 more answers
Write a boolean method that checks whether a given positive integer n is a perfect square. Use Math’s sqrt and round methods to
svetoff [14.1K]
In java...

public boolean checkSquare(int n){

int actualNumber = n;
int squareRoot = (int)Math.sqrt(n);
int squaredNumber = Math.pow(squareRoot,2);

if(squaredNumber==actualNumber){
return true;
} else {
return false;
}

}
5 0
2 years ago
Write a second constructor as indicated. Sample output: User1: Minutes: 0, Messages: 0 User2: Minutes: 1000, Messages: 5000
Mashcka [7]

Complete Question:

Write a second constructor as indicated. Sample output:User1: Minutes: 0, Messages: 0User2: Minutes: 1000, Messages: 5000// ===== Code from file PhonePlan.java =====public class PhonePlan { private int freeMinutes; private int freeMessages; public PhonePlan() { freeMinutes = 0; freeMessages = 0; } // FIXME: Create a second constructor with numMinutes and numMessages parameters. /* Your solution goes here */ public void print() { System.out.println("Minutes: " + freeMinutes + ", Messages: " + freeMessages); return; }}

Answer:

The second constructor is given as:

//This defines the constructor, the name has to be the same as the class //name

PhonePlan(int numOfMinutes, int numberOfMessages) {

this.freeMinutes = numOfMinutes;

this.freeMessages = numberOfMessages

}

Explanation:

The second constructor is defined using java programming language.

  1. The given class has two constructors This is called "Constructor Overloading) which implements polymophism
  2. In the second constructor that we created, we pass in two arguments of type integer numOfMinutes and numberOfMessages.
  3. In the constructor's body we assign these values to the initially declared variables freeMinutes and freeMessages
6 0
1 year ago
Other questions:
  • Blender questions
    8·2 answers
  • Rupa would like to quickly insert a table into her document without having to worry about formatting the data in the table. Whic
    5·2 answers
  • Which two factors most influenced the growth of the Internet during the 1970s?
    7·2 answers
  • An organization has a datacenter manned 24 hours a day that processes highly sensitive information. The datacenter includes emai
    5·1 answer
  • The following checksum formula is widely used by banks and credit card companies to validate legal account numbers: d0 + f(d1) +
    13·1 answer
  • Write multiple if statements: If carYear is before 1968, print "Probably has few safety features." (without quotes). If after 19
    6·1 answer
  • Suppose that we have a set of activities to schedule among a large number of lecture halls, where any activity can take place in
    8·1 answer
  • For his class project, Matt has to create an image in a color scheme that has shade or tint variations of the same hue. Which co
    7·1 answer
  • Describe a strategy for avoiding nested conditionals. Give your own example of a nested conditional that can be modified to beco
    15·1 answer
  • Which business case is better solved by Artificial Intelligence (AI) than conventional programming
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!