When complete, the following
#include <iostream>
// include any other necessary header files
using namespace std;
int main()
{
char place[] = "The Windy City";
// Complete the program. It should search the array place
// for the string "Windy" and display the message "Windy
// found" if it finds the string. Otherwise, it should
// display the message "Windy not found."
return 0;
}
Want to see the full answer?
Check out a sample textbook solutionChapter 10 Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Objects (6th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
Computer Science: An Overview (12th Edition)
Introduction To Programming Using Visual Basic (11th Edition)
Java: An Introduction to Problem Solving and Programming (7th Edition)
Starting Out With Visual Basic (7th Edition)
- // MichiganCities.cpp - This program prints a message for invalid cities in Michigan. // Input: Interactive // Output: Error message or nothing #include <iostream> #include <string> using namespace std; int main() { // Declare variables string inCity; // name of city to look up in array const int NUM_CITIES = 10; // Initialized array of cities string citiesInMichigan[] = {"Acme", "Albion", "Detroit", "Watervliet", "Coloma", "Saginaw", "Richland", "Glenn", "Midland", "Brooklyn"}; bool foundIt = false; // Flag variable int x; // Loop control variable // Get user input cout << "Enter name of city: "; cin >> inCity; // Write your loop here // Write your test statement here to see if there is // a match. Set the flag to true if city is found. // Test to see if city was not found to determine if // "Not a city in Michigan" message should be printed.…arrow_forward// MichiganCities.cpp - This program prints a message for invalid cities in Michigan. // Input: Interactive // Output: Error message or nothing #include <iostream> #include <string> using namespace std; int main() { // Declare variables string inCity; // name of city to look up in array const int NUM_CITIES = 10; // Initialized array of cities string citiesInMichigan[] = {"Acme", "Albion", "Detroit", "Watervliet", "Coloma", "Saginaw", "Richland", "Glenn", "Midland", "Brooklyn"}; bool foundIt = false; // Flag variable int x; // Loop control variable // Get user input cout << "Enter name of city: "; cin >> inCity; // Write your loop here // Write your test statement here to see if there is // a match. Set the flag to true if city is found. // Test to see if city was not found to determine if // "Not a city in Michigan" message should be printed.…arrow_forwardGiven a map pre-filled with student names as keys and grades as values, complete main() by reading in the name of a student, outputting their original grade, and then reading in and outputting their new grade. Ex: If the input is: Quincy Wraight 73.1 the output is: Quincy Wraight's original grade: 65.4 Quincy Wraight's new grade: 73.1arrow_forward
- #include #include #include "Product.h". using namespace std; int main() { vector productList; Product currProduct; int currPrice; string currName; unsigned int i; Product resultProduct; cin >> currPrice; while (currPrice > 0) { cin >> currName; currProduct.SetPriceAndName (currPrice, currName); productList.push_back (currProduct); cin >> currPrice; } resultProduct = productList.at(0); for (i = 0; i resultProduct.GetPrice()) { resultProduct = productList.at(i); } CS re 0; ultProduct.GetName() << " " << result Product.GetPrice() << endl; Input 10 Berries 8 Paper 7 Socks -1 Output ||^arrow_forward#include <stdio.h>#include <string.h>#define SIZE 6struct Cake {char name[50];float price;};int searchChoice(char *choice, struct Cake data[]);void displayChoice(int index, struct Cake data[]);int main() {char choice[50];int index;//Answer for Part (i) – Declare and initialise array stockprintf("What is your choice of cake? ");gets(choice);index = searchChoice(choice, stock);displayChoice(index, stock);return 0;}//Answer for Part (ii) – Function definition for searchChoice//Answer for Part (iii) – Function definition for displayChoicearrow_forward#ifndef lab5ExF_h #define lab5ExF_h typedef struct point { char label[10]; double x ; // x coordinate for point in a Cartesian coordinate system double y; // y coordinate for point in a Cartesian coordinate system double z; // z coordinate for point in a Cartesian coordinate system }Point; void reverse (Point *a, int n); /* REQUIRES: Elements a[0] ... a[n-2], a[n-1] exists. * PROMISES: places the existing Point objects in array a, in reverse order. * The new a[0] value is the old a[n-1] value, the new a[1] is the * old a[n-2], etc. */ int search(const Point* struct_array, const char* target, int n); /* REQUIRES: Elements struct-array[0] ... struct_array[n-2], struct_array[n-1] * exists. target points to string to be searched for. * PROMISES: returns the index of the element in the array that contains an * instance of point with a matching label. Otherwise, if there is * no point in the array that its label matches the target-label, * it should return -1. * If there are more than…arrow_forward
- Hi I need help please I am supposed to create a display function that will display the songs in an array, but I am stuck The display member function takes a string parameter representing a keyword that would be used to search the invoking PlayList object. The function should display the titles of songs that contain the given string keyword, case-insensitive. If no match is found, the function shall display a message indicating no match is found. The default value for keyword is an empty string... " ", indicating that the function should display all song titles in the PlayList if nothing is enteredarrow_forwardGrade Book A teacher would like to assign a letter grade to a student, based on student's test score. Write a program to help this teacher managing her students' test score. Use the following grading scale to assign a letter grade to a student. Test Score Letter Grade 80 - 100 A 70 - 79 B 60 69 C 50 - 59 0- 49 F Your program must have an array of string objects to hold the student names and an array of int to hold the student scores. Let the teacher determines the number of students and ask the teacher to enter the information for each student. Your program should have the following programmer-defined functions: getInput () - to read the students name and scores from user getGrade () - to determine the letter grade corresponding to the score getReport () - to determine the maximum, minimum, average and standard deviation of the scores Display an error message if the teacher enter mark below 0 or above 100, and keep asking for a valid value. The program should also be capable of…arrow_forwardYou will write a program that allows the user to enter 10 songs and their artists into a playlist and will sort the entries by artist order. The program should use a 10 element array of structure objects that holds two string variables: artist and title.arrow_forward
- C++ Coding Write a program that asks a teacher to enter the student's name and the grades received on her quarterly exams. The datatype for the student's name could be a string and the four grades should be entered in an array of data types int. Test scores are on the base of 100. REMINDER: sum and cap CANNOT be integers. The main() functions describe the average function with the following title line: double avg( int grades[], int cap ) The program prints the student's name, her four grades, and her average grades The main() function also uses the following print function: void print( int grades[], int cap);arrow_forwardQUESTION 23 Write a C# console application named TotalCharge that asks the user to enter 5 positive integers, representing the ordered quantities of 5 items. You need to store the 5 integers in an int array. In your program, you also need to declare and initialize a parallel array that contains the corresponding prices of the 5 items, which are (1.65, 7.66, 3.19, 10.68, 2.99). You need to use a loop to calculate the total charge, which is the sum of each item quantity multiplied by its price. The format of the output message should be "The total charge is SXX.XX". Attach Filearrow_forwardBased on the following code, the auto keyword creates the variable "i" as what data type? sinclude sinclude int main() std::vector COP3503; for (unsigned int i - 1; i ::iterator O vector O int O unsigned int o iterator::vectorarrow_forward
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning