Computers and Technology

1. Write a function called changeLetter that can directly alter the value of a character variable. It takes one argument: a reference to a character. It returns nothing. If the passed in character is alphabetic ('a' to 'z' or 'A' to 'Z'), then make the character become the next higher ASCII value ('a' becomes 'b' etc.). If the passed in character is not a letter, don't alter it. 2. Write a calling statement for the changeLetter function. It takes one argument: a reference to a character and returns nothing. The calling statement should pass the char variable ch so that it is (potentially) altered.
3. Write a calling statement for the changeLetter function. It takes one argument: a reference to a character and returns nothing. The calling statement should pass the 2nd character in a char array called chAr (by second, I mean the sub-oneth) so that it is (potentially) altered.
4. Assume the following function header:

void fn( int &n )

Write an instruction for the function body that will store 10 into the caller's variable referred to by n.
5. Write a calling statement for the fn function. It takes one argument: a reference to an integer and returns nothing. The calling should pass the integer variable num to the function so that it can be altered.
6. The strlen() function returns
A. the number of chars in an array of char, including the null
B. the number of chars in an array of char not including the null
C. the declared number of chars an array can hold
7. What must be true of the arguments to strcat(s1, s2); More than one answer may be correct
A. s1 must be valid strings
B. s2 must be a valid string
C. s1 must have room to contain the result
D. s2 must have room to contain the result
8. How is a structure different from an array?
9. Write a definition for a structure called Part that can hold a part name (an array of characters that can hold 24 characters plus a null terminator), a part weight (int), and a part price (float). Make up appropriate names.
10. Assume the following structure definition:

struct Person

{

char name[50];

int age;

};

Write a declaration for a variable of type Person and initialize it with your name and the age 10. This should be done as part of the variable declaration statement.

11. Assume the following structure definition:

struct Person

{

char name[50];

int age;

};

Write a declaration for a variable of type Person and initialize it with your name and the age 10. This should be done as several executable statements.

12. Declare an array of 10 Person structures named peopleArray.

13. Assume the following structure definition and declaration:

struct Person

{

char name[50];

int age;

};

Person people[265];

Assuming that the people array contains 265 valid structs, write code to print out the age member for each item in the structure.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 09:50, shadow29916
What is a rush associated with alcohol?
Answers: 1
image
Computers and Technology, 23.06.2019 00:30, lilobekker5219
Knowing that the central portion of link bd has a uniform cross sectional area of 800 mm2 , determine the magnitude of the load p for which the normal stress in link bd is 50 mpa. (hint: link bd is a two-force member.) ans: p = 62.7 kn
Answers: 2
image
Computers and Technology, 23.06.2019 02:50, CrusaderLord
Define a class named movie. include private fields for the title, year, and name of the director. include three public functions withprototypes void movie: : settitle(cstring); , voidmovie: : setyear(int); , void movie: : setdirector(string); . includeanother function that displays all the information about a movie. write a main() function that declares a movie object namedmyfavoritemovie. set and display the object's fields. this is what i have but know its wrong since it will notcompile: #include#includeusing namespace std; //class declarationclass movie{private: string movietitle ; string movieyear; string directorname; public: void settitle(string title); void setyear(string year); void setdirector(string director); void displayinfo(); }; //class implementationvoid movie: : settitle(string title){ movietitle = title; cout< < "what is the title of themovie? "< > temp; myfavoritemovie. settitle(temp); cout< < "enter movie year"< > temp; myfavoritemovie. setyear(temp); cout< < "enter director'sname"< > temp; myfavoritemovie. setdirector(temp); //display all the data myfavoritemovie. displayinfo(); system("pause"); return 0; this code is not entirely mine someone on cramster edited my firstcode but then i try manipulating the new code and i still get acompile error message : \documents\visual studio 2008\projects\movie\movie\movie. cpp(46) : error c2679: binary '< < ' : no operator found which takes aright-hand operand of type 'std: : string' (or there is no acceptableconversion)c: \program files (x86)\microsoft visual studio9.0\vc\include\ostream(653): could be'std: : basic_ostream< _elem,_traits> & std: : operator< < > (std: : basic_ostream< _elem,_traits> & ,const char *)w
Answers: 1
image
Computers and Technology, 23.06.2019 08:30, sofigaviria05
All of these are true about using adhesive except: a. dissimilar materials can be joined. b. mixing tips are product and material specific. c. a specific application gun may be required. d. two-part adhesives are dispensed using two mixing tips
Answers: 3
Do you know the correct answer?
1. Write a function called changeLetter that can directly alter the value of a character variable. I...

Questions in other subjects:

Konu
Mathematics, 02.11.2019 05:31