Concept explainers
toupper:
The lowercase letter will be converted by uppercase letter using “toupper” function.
Example:
Consider the example of “toupper” is as follows:
//declare the variable
char c;
//convert equivalent lowercase letter
c = toupper ('x');
//display the output
cout << c;
Here, the “toupper” function is used to convert the given character into uppercase letter.
tolower:
The uppercase letter will be converted by lowercase letter using “tolower” function.
Example:
Consider the example of “tolower” is as follows:
//declare the variable
char c;
//convert equivalent lowercase letter
c = tolower ('X');
//display the output
cout << c;
Here, the “tolower” function is used to convert the given character into lowercase letter.
Want to see the full answer?
Check out a sample textbook solutionChapter 10 Solutions
MyLab Programming with Pearson eText -- Access Card -- for Starting Out with C++ from Control Structures to Objects (My Programming Lab)
- C++ enum Major {COMPUTER_SCIENCE, COMPUTER_SECURITY_INFO_ASSURANCE, CYBER_SECURITY, ELECTRICAL_ENGINEERING, OTHER}; struct Name { string first; string last; char middleInitial; }; struct StudentRecord { Name studentName; Major major; string email; }; StudentRecord student12; Suppose you are student12. Show the C++ statements used to fill in all of your information for your StudentRecord. Show how would you assign the third letter from the email field to a local char variable called myChar.arrow_forwardQuestion 1 is already done need help with the others though This is the C code I have so far #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; struct employees **emps = new employees()[10]; //Added new statement ---- bartleby // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for(int i =0; i <9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to…arrow_forwardGiven the declaration:char name[30];mark the following statements as valid or invalid. If a statement isinvalid, explain why.a. name = "Bill William";b. strcmp(name, "Tom Jackson");c. strcpy(name, "Jacksonville");d. cin >> name;e. name[0] = 'K';f. bool flag = (name >= "Cynthia");arrow_forward
- In which memory segments are the variables in the following code located? int i = 0; void func(char *str) { char *ptr = malloc(sizeof(int)); char buf[1024]; int j; static int y; }arrow_forwardModify the following code with the comment include <stdio.h>#include <stdlib.h>#include <stdbool.h>#include <string.h>#include <time.h> int main(void) { int arr[2][2] ={{500, 1000}, {750, 325}}; char name, acc_type; int amt; printf("\nEnter your name:") scanf("%c", &name) ; getchar(); printf("\nWould you like you withdraw from (c) Checkings or (s) Savings:") ; scanf("%c", &acc_type) ; printf("\nHow much would you like to withdraw:"); scanf("%d", &amt); if(name == 'a') { switch(acc_type) { case c: printf("\n Amount in account to be withdrawn from: 500"); printf("\nAmount in account after withdrawal:%d",500-amt);break; case s: printf("\n Amount in account to be withdrawn from: 1000);printf("\nAmount in account after withdrawal:%d",1000-amt);break; } } if(name=='b') { switch(acc_type) { case c: printf("\n Amount in account to be withdrawn from: 750"); printf("\nAmount in account after withdrawal:%d",750-amt);break; case s: printf("\n Amount…arrow_forwardI get an error when I submit my program. My code is as follows #include<iostream> using namespace std; int main() { cout.setf(ios::fixed); cout.setf(ios::showpoint); // show decimals even if not needed cout.precision(2); // two places to the right of the decimal // TODO: enter the missing types below int time; float ticketPrice; char destination; //'C'=Chicago, 'P'=Portland, 'M'=Miami char typeOfDay; //'D'=weekDay 'E'=weekEnd bool isDayTime = false,isWeekend; cout << "Welcome to Fordham Airlines!" << endl; cout << "What is your destination? ([C]hicago, [M]iami, [P]ortland) "; cin >> destination; cout << "What time will you travel? (Enter time between 0-2359) "; cin >> time; // TODO: set isDayTime to true if time 5AM or later, but before 7PM if(time>500&&time<1900){ isDayTime = true; } cout << "What type of day are you traveling? (week[E]nd or week[D]ay) "; cin >> typeOfDay; // TODO: set isWeekend to true if typeOfDay…arrow_forward
- C++ Please! Also please don't use functions, arrays, or classes. Just basic c++ please. Password Verifier Write a C++ program to verify that a user’s password meets the following criteria: 1. The password should be at least 6 characters long. 2. The password should contain at least one uppercase and one lowercase letter. 3. The password should have at least one digit. Your program should ask the user for a password and verify that it meets the following criteria. If it doesn’t a message should be displayed telling the user why.arrow_forwardstruct date{ int day; int month; int year; }; Write a function named void increaseDay(struct date *d) that increases the value of a variable of struct date type with integer year, month, and day members by one day. Write a function named void decreaseDay(struct date *d) that decreases the value of a variable of struct date type with integer year, month, and day members by one day. Write a C program that reads from the user a date in d/m/y format and the amount of increase or decrease as an integer. Display the new date in d/m/y format. You may call related functions as many as given increase or decrease value. Note 1: You do not need to consider leap years. Use always 28 days for month February. Note 2: Do not modify the function prototypes. Sample Input1: Sample Output1: 12/8/1990 -5 7/8/1990 Sample Input2: Sample Output2: 26/2/2005 5 3/3/2005 Sample Input3: Sample Output3: 29/12/1998 7 5/1/1999…arrow_forwardSuppose that num is an int variable and discard is a char variable. Assume the following input data:#34What value (if any) is assigned to num and discard after each of the following statements executes? (Use the same input for each statement.)a. cin.get(discard);cin >> num;b. discard = cin.peek();cin >> num;c. cin.get(discard);cin.putback(discard);cin >> discard;cin >> num;arrow_forward
- my_round(number, integer): Based on the built-in round(...) function. Takes an integer or float and returns a rounded float value that is the number rounded to the second argument's decimal place. First argument can be any float or integer. Second argument must be an integer. Examples: my_round(1234.5678, 2) and round(1234.5678, 2) should return 1234.57. my_round(1234.5678, -2) and round(1234.5678, -2) should return 1200.0.arrow_forwardThis is the C code I have so far #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; struct employees **emps = new employees()[10]; //Added new statement ---- bartleby // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for(int i =0; i <9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to print the employee data to console void display(struct employees…arrow_forwardC++: Describe how the following call by reference works. Make a comment for each line. void pxc(int& c, int& d) { int k = c; c = d; d = k; } int main() { int a = 15, b = 100; pxc(a, b); }arrow_forward
- 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