Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program reads a name (a string) and an age (an int) from the standard in

ID: 3841194 • Letter: W

Question

Write a program reads a name (a string) and an age (an int) from the standard input stream cin. Then, output a message including the name and age to the standard stream cout. Write a function that checks if a vector of strings is sorted in alphabetical order or not. The function should take as input a vector of strings. If the vector is sorted, then the function should return true; if it is not sorted, then the function should return false. You may use the following function prototype: bool isSorted (vector list); Assume that you have two vectors. One vector holds a dictionary of words and/or phrases (represented as strings) and the other vector contains a dictionary of abbreviations for those words (also represented as strings). Write a function that reads a file string-by-string and returns the contents of the file to a string, with any abbreviated words or phrases in >our dictionary that appear in the input file replaced by the corresponding word or phrase. You may use the following function prototype: string abbrToFull(string filename, vector acbrDict, vector fullDict);

Explanation / Answer

#include <iostream>
#include<string.h>
using namespace std;

int main ()
{
char name[12];
cout << "Please enter the string: ";
cin>>name;
cout << "The value you entered is: " << name;
int age;
cout << "Please enter an integer value: ";
cin >> age;
cout << "The value you entered is " << age;
  
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote