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
Svetllana [295]
3 years ago
5

Create vector of Color variables

Computers and Technology
1 answer:
Law Incorporation [45]3 years ago
8 0

Answer:

See explaination

Explanation:

balloon.h

#ifndef BALLOON_H

#define BALLOON_H

enum Color {red, orange, yellow, green, blue, indigo, violet};

#endif

main.cpp

#include <iostream>

#include <string>

#include <vector>

#include "balloon.h"

using namespace std;

int main( )

{

vector<Color> colors;

Color color;

string input;

while(true){

cout<<"What color do you want to add? ";

cin>>input;

if(input=="end"){

break;

}else if(input=="red"){

color = red;

colors.push_back(color);

}else if(input=="orange"){

color = orange;

colors.push_back(color);

}else if(input=="yellow"){

color = yellow;

colors.push_back(color);

}else if(input=="green"){

color = green;

colors.push_back(color);

}else if(input=="blue"){

color = blue;

colors.push_back(color);

}else if(input=="indigo"){

color = indigo;

colors.push_back(color);

}else if(input=="violet"){

color = violet;

colors.push_back(color);

}

}

for(int i=0;i<colors.size();i++){

cout<<colors[i]<<endl;

}

return 0;

}

You might be interested in
Write a java code to print Multiplication Table Till 20
Ket [755]

Explanation:

Do not disturb me everyone

8 0
3 years ago
Read 2 more answers
Which operating system function has a steeper learning curve and can potentially break the system without careful use of its ope
grandymaker [24]

Answer:

4. Command line interface (CLI)

Explanation:

An operating system is a system software pre-installed on a computing device to manage or control software application, computer hardware and user processes.

This ultimately implies that, an operating system acts as an interface or intermediary between the computer end user and the hardware portion of the computer system (computer hardware) in the processing and execution of instructions.

Some examples of an operating system on computers are QNX, Linux, OpenVMS, MacOS, Microsoft windows, IBM, Solaris, VM etc.

A Command line interface (CLI) refers to a text-based user interface that allow users to operate a software application or program, as well as manage and execute operating system functions by typing standard line of commands into the text-based user interface with a real-time response.

Basically, the CLI is solely text-based and as such requires a thorough knowledge and understanding of global commands, as well as administrative privileges in some cases.

<em>Hence, the operating system function which has a steeper learning curve (more difficult to learn) and can potentially break the system without careful use of its operations is the Command line interface (CLI). </em>

3 0
3 years ago
Suppose that we have a set of activities to schedule among a large number of lecture halls, where any activity can take place in
laiz [17]

Answer:

By Using the Greedy- Activity- Selection algorithm

Explanation:

The Greedy- Activity- Selection algorithm in this case involves

First finding a maximum size set S1, of compatible activities from S for the first lecture hall.

Then using it again to find a maximum size set S2 of compatible activities from S - S1 for the second hall.

This is repeated till all the activities are assigned.

It requires θ(n2) time in its worse .

8 0
3 years ago
When using bits to represent fractions of a number, can you make all possible fractions?
saw5 [17]
This is your perfect answer

8 0
3 years ago
Write a JavaScript program to generate the following pattern but the number of rows should be user input.
Nookie1986 [14]

Answer:

Testicles

Explanation:

u sukkk

3 0
3 years ago
Other questions:
  • Julie bought a house for $315,000 and has a $285,000 mortgage. she claims she has $315,000 in equity. is she correct? if not, ho
    12·2 answers
  • Prove that for every nfa with an arbitrary number of final states there is an equivalent nfa with only one final state. Can we m
    8·1 answer
  • How is a computer component, such as a network card, commonly marked for identification?
    12·1 answer
  • Hi I am Khine Mye and I want to ask you a question I don't know that is square root of 2 is 1.4 and how to get that 1.4 and plz
    8·1 answer
  • What is Administrator windows 10
    8·1 answer
  • Which elements are in the Sort dialog box? Check all that apply.
    9·1 answer
  • How to solve a program that accepts a number as input and prints just the decimal portion
    15·2 answers
  • Design and implement a class dayType that implements the day of the week in a program. The class dayType should store the day, s
    11·1 answer
  • HELP PLS!!! In a presentation, what is layout?
    10·2 answers
  • The way a student prepares for a test or reviews academic material is referred to as
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!