Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Need help with C++.
Read the string variables favoriteColor1 and favoriteColor2 from input, assuming that each color is a single word.
Ex: If the input is yellow brown, then the output is:
Favorite colors: yellow, brown
'''
#include <iostream>
#include <string>
using namespace std;
int main() {
string favoriteColor1;
string favoriteColor2;
/* Your code goes here */
cout << "Favorite colors: " << favoriteColor1 << ", " << favoriteColor2 << endl;
return 0;
}
'''
SAVE
AI-Generated Solution
info
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
Unlock instant AI solutions
Tap the button
to generate a solution
to generate a solution
Click the button to generate
a solution
a solution
Knowledge Booster
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
- please use DEQUE #include <iostream>#include <string>#include <deque> using namespace std; const int AIRPORT_COUNT = 12;string airports[AIRPORT_COUNT] = {"DAL","ABQ","DEN","MSY","HOU","SAT","CRP","MID","OKC","OMA","MDW","TUL"}; int main(){// define stack (or queue ) herestring origin;string dest;string citypair;cout << "Loading the CONTAINER ..." << endl;// LOAD THE STACK ( or queue) HERE// Create all the possible Airport combinations that could exist from the list provided.// i.e DALABQ, DALDEN, ...., ABQDAL, ABQDEN ...// DO NOT Load SameSame - DALDAL, ABQABQ, etc .. cout << "Getting data from the CONTAINER ..." << endl;// Retrieve data from the STACK/QUEUE here } Using the attached shell program (AirportCombos.cpp), create a list of strings to process and place on a STL DEQUE container. Using the provided 3 char airport codes, create a 6 character string that is the origin & destination city pair. Create all the possible…arrow_forwardplease created a c++ code regarding this screenshot i add and also please add professional comments in it using the // commandarrow_forwardIn C++ Write a function named find_bigfoot which takes a string as an argument, and then determines whether the string "bigfoot" is found in the parameter. Then it returns true or false, depending on whether it was found or not. For example: find_bigfoot("There is no yeti");find_bigfoot("footbig not here"); would both return false, since the string bigfoot isn't part of the string while: find_bigfoot("I believe in bigfoot");find_bigfoot("bigfoot is around here"); would both return true, since the string bigfoot is part of the string.arrow_forward
- Programming language: SWIFT Write a function that takes a string as a parameter and returns the string "Swift" if the string passed as parameter begins with "SWIFT" or "swift". Otherwise, returns an empty string.arrow_forwardThis is a program in C language. Help me debug this program. it has 3 errors. Please upload a screenshot also that it is working thank you./* This porgram uses the gotoxy() function and textcolor() for better screen display */ #include <iostream>#include <conio.h>#include <stdlib.h>using namespace std;main(){ int NoItem,ItemNo,Qty,ctr,Row=5; float UPrice,TAmt,ATendered,Change,APaid=0; char ItemDesc[15],TempChar; system("Color 5");; system("Color 2"); gotoxy(25,1);cout<< "[***] RICHLY SUPERMARKET [***]"; gotoxy(31,2);cout<< "Ayala Avenue, Makati"; gotoxy(6,4);cout<< "Item No. Description Qty. Unit Price Total Amount"; gotoxy(5,22);cout<< "No. of Item(s) Bought => [ ]"; gotoxy(37,22);cout<< "Total Amount to be Paid => "; gotoxy(37,23);cout<< "Amount Customer Tendered => "; gotoxy(37,24);cout<< "Amount of Change => "; gotoxy(31,22);cin>> NoItem;…arrow_forwardWrite the countVowels function which counts the number of vowels using the string class as follows: int countVowels(const string& s) Write a test program that prompts the user to enter a string, invokes the countVowels function and displays the total number of vowels in the string.arrow_forward
- Urgent solve using C++ Notes: The maximum size of any c-string in this lab is 100 characters and it should be dynamically allocated in the constructor and de-allocated in the destructor. For Visual Studio you need to put the following line as first top line in your source code file: #define _CRT_SECURE_NO_WARNINGS Question 1: The class Person contains the following properties and functions: Name (c-string ), private Age (int), private Address (c-string), private Constructors ( default and non-default) Getters and Setters Destructor: to free the memory and print the message “Object with name [PERSON_NAME] is dead” where PERSON_NAME is the person name for the object being disposed. Print function to print the details of the employee. Test your class with the following main: int main() { Person per1; Person per2("Ahmad", "AUS Campus", 21); cout << "Person per1 :\n"; per1.print(); cout << "\nPerson per2 :\n"; per2.print(); cout<<"\nTesting the setters…arrow_forwardFlowchart, create. // Cornwall.cpp - This program computes hotel guest rates. // Input: None // Output: Hotel guest rate #include <iostream> #include <string> using namespace std; double computeRate(int); double computeRate(int, string); int main() { int days; string mealPlan; string question; double rate = 0.0; cout << "How many days do you plan to stay? " << endl; cin >> days; cout << "Do you want a meal plan? Y or N: " << endl; cin >> question; // Figure out which arguments to pass to the computeRate() function and // then call the computeRate() function cout << "The rate for your stay is $507" << rate << endl; cout << "The rate for your stay is $599.94" << rate << endl; return 0; } // End of main() function // Write computeRate functions here.arrow_forwardIn C++, using STL algorithms, use the text file shoes.txt, where you want to sell a pair of shoes to a customer. The price must come from the text file, and can be used to get the total for any shoe the user may choose. CONSOLE cout << "what shoes do you want to buy"; cin >> heels; cout << " that will be " shoe_price "!"; The cout should return " That will be $20 ! shoes.txt items: heels $20 shoes $12 yeezys $289 jordans $150arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education