All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
computer science
microsoft visual c# introduction
Questions and Answers of
Microsoft Visual C# Introduction
In this exercise, you modify the Rectangle class from Lab 15-2 so that it includes an overloaded method. a. If necessary, create a new project named Advanced20 Project and save it in the
In this exercise, you modify the Terney Landscaping program from Lab 15-2 so that it passes an object to a function. a. If necessary, create a new project named Advanced19 Project and save it in
In this exercise, you modify an existing header file. a. Follow the instructions for starting C++ and viewing the Advanced18.cpp and Advanced18 MyDate.h files, which are contained in either the
In this exercise, you create a Triangle class and a program that uses the Triangle class to instantiate a Triangle object. a. If necessary, create a new project named Intermediate17 Project and
In this exercise, you modify the Rectangle class from Lab 15-2 so that its setDimensions method returns a value. You also modify the Terney Landscaping program. a. If necessary, create a new
In this exercise, you modify the Rectangle class from Lab 15-2 so that it allows a program to view the contents of the length and width data members. You also modify the Terney Landscaping program so
In this exercise, you use the Rectangle class from Lab 15-2 to instantiate a Rectangle object in the All-Around Fence Company program. If necessary, create a new project named Intermediate14 Project.
In this exercise, you complete a program that uses the Square class shown in Figure 15-6 in the chapter. Follow the instructions for starting C++ and viewing the Introductory13.cpp file, which is
In this exercise, you modify the program from Lab 15-4. If necessary, create a new project named ModifyThis12 Project and save it in the Cpp8\Chap15 folder. Copy the instructions from the Lab15-4.cpp
Correct the errors in the Item class shown in Figure 15-21. //declaration section class Item { private: item(); void assignItem (string, double); public: string name; double price;
Write the code for two overloaded methods named getArea. The methods belong to the Square class. The first getArea method should accept two integers. The second getArea method should accept two
A program creates an Animal object named dog. Which of the following calls the displayBreed method, which is a public member method contained in the Animal class? a.
Which of the following creates an Animal object named dog? a. Animal dog; b. Animal "dog"; c. dog = "Animal"; d. dog Animal();
Which of the following statements is false? a. You typically use a public member method to change the value stored in a private data member. b. Because a constructor does not return a
The name of the constructor for a class named Animal is _____________________. a. Animal b. AnimalConstructor c. ConstAnimal d. Any of the above could be used as the name of the
Which of the following is the scope resolution operator? a. :: (two colons) b. * (asterisk) c. . (period) d. -> (hyphen and greater than symbol)
The method definitions for a class are entered in the _____________________ section in the class definition. a. Declaration b. Implementation c. Method d. Program-defined
In most classes, you expose the _____________________ and hide the _____________________. a. Attributes, data members b. Data members, member methods c. Member methods, data
A program can access the private members of a class _____________________. a. Directly b. Only through the public members of the class c. Only through other private members of the
You hide a member of a class by recording the member below the keyword _____________________ in the class statement. a. Confidential b. Hidden c. Private d. Restricted
Which of the following statements is false? a. An example of an attribute is the minutes variable in a Time class.b. An example of a behavior is the setTime method in a Time class. c. An
A blueprint for creating an object in C++ is called _____________________. a. A class b. An instance c. A map d. A pattern
Follow the instructions for starting C++ and viewing the SwatTheBugs30.cpp file, which is contained in either the Cpp8\Chap14\SwatTheBugs30 Project folder or the Cpp8\Chap14 folder. (Depending on
If necessary, create a new project named Advanced29 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Advanced29.cpp. If you are using Microsoft Visual C++, copy the
If necessary, create a new project named Advanced28 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Advanced28.cpp. If you are using Microsoft Visual C++, copy the
If necessary, create a new project named Advanced27 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Advanced27.cpp. If you are using Microsoft Visual C++, copy the
If necessary, create a new project named Advanced26 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Advanced26.cpp. Write a program that allows the user to record
If necessary, create a new project named Advanced25 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Advanced25.cpp. If you are using Microsoft Visual C++, copy the
If necessary, create a new project named Intermediate24 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Intermediate24.cpp. If you are using Microsoft Visual C++,
If necessary, create a new project named Intermediate23 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Intermediate23.cpp. If you are using Microsoft Visual C++,
If necessary, create a new project named Intermediate22 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Intermediate22.cpp. If you are using Microsoft Visual C++,
If necessary, create a new project named Introductory21 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Introductory21.cpp. If you are using Microsoft Visual C++,
If necessary, create a new project named Introductory20 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Introductory20.cpp. Create a program that saves prices in a
If necessary, create a new project named Introductory19 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Introductory19.cpp. Create a program that saves a
Correct the condition in the following if clause, which should determine whether the open function was able to open the file associated with the outFile object: if (outFile.open()).
A program needs to read a sequential access file, line by line, and display each line on the computer screen. The file, which was opened successfully, is associated with the inFile object. Write the
Write a while clause that tells the computer to stop processing the loop instructions when the end of the file has been reached. The file is associated with the inFile object.
A program needs to write the contents of a string variable named capital and the newline character to the sequential access file associated with the outFile object. Write the code to accomplish this
A program needs to write the string “Employee” and the string “Name” to the sequential access file associated with the outFile object. Each string should appear on a separate line in the
Write the statement to close the janSales.txt file, which is associated with the outFile object.
Write the statement to read a number from the sequential access file associated with the inFile object. Assign the number to the number variable.
Write the statement to read a string from the sequential access file associated with the inFile object. Assign the string to the textLine variable.
Write an if clause that determines whether an output file was opened successfully. The file is associated with the outSales object.
Write the statement to open a sequential access file named febSales.txt for output. The file is associated with the outFeb object.
Write the statement to open a sequential access file named firstQtr.txt for append. The file is associated with the outSales object.
Write the statement to open a sequential access file named inventory.txt for input. The file is associated with the inInventory object.
Which of the following opens the payroll.txt file for input? The file is associated with the inFile object. a. inFile.open("payroll.txt", ios::app); b. inFile.open("payroll.txt"); c.
Which of the following creates an object named inPayroll that represents an input file in the program? a. instream inPayroll; b. ifstream inPayroll; c. inPayroll ifstream; d.
Which of the following tells the computer to repeat the loop instructions until the end of the file is reached? The file is associated with the inFile object. a. while (inFile.eof()) b.
Which of the following writes the contents of the city and state variables to an output file named address.txt? The file is associated with the outFile object. a. address.txt << city
Which of the following reads a number from an input file named managers.txt and stores the number in the salary variable? The file is associated with the inFile object. a. managers.dat <<
Which of the following writes the contents of the city variable to an output file named address.txt? The file is associated with the outFile object. a. address.txt << city <<
Which function determines whether the open function was successful? a. is_open b. isopen c. isFileOpen d. is_FileOpen
Which function closes a sequential access file? a. Close b. End c. Exit d. Finish
Which mode is used in the open function to add records to the end of an existing output file? a. add b. ios::add c. ios::app d. ios::out
Which of the following opens the payroll.txt file for output? The file is associated with the outPayroll object. a. outPayroll.open("payroll.txt"); b. outPayroll.open("payroll.txt",
Which of the following creates an object named outPayroll that represents an output file in the program? a. fstream outPayroll; b. ofstream outPayroll; c. outPayroll as
You use the _____________________ class to instantiate an output file object. a. cout b. fstream c. ofstream d. outstream
For a program to create a file object, it must include the _____________________ file. a. fileStream b. fstream c. outFile d. sequential
When processed, which of the following can consume the newline character? a. >> operator b. << operator c. getline functiond. Both a and c
Which of the following statements tells the computer to consume the next 100 characters? a. cin.ignore(100); b. cin.ignore('100'); c. ignore(cin, 100); d. None of the above
Which of the following assigns the fifth character in the word variable to the letter variable? a. letter = word.substr(4); b. letter = word.substr(4, 1); c. letter =
Which of the following concatenates the contents of a string variable named city, a comma, a space, and the contents of a string variable named state and then assigns the result to a string variable
Which of the following assigns five asterisks to a string variable named divider?a. divider.assign(5, '*'); b. divider.assign(5, "*"); c. divider.assign('*', 5); d. assign(divider,
Which of the following replaces the two characters located in subscripts 4 and 5 in a string variable named code with the string “AB”? a. code.replace(2, 4, "AB"); b. code.replace(4, 2,
If the state variable contains the string “San Francisco, CA”, what will the correct statement in Question 14 assign to the result variable? a. –1 b. 0 c. 11 d. 15 Data
Which of the following searches for the string “CA” in a string variable named state and then assigns the result to an int variable named result? The search should begin with the character
Which of the following statements assigns the location of the comma in the amount variable to an int variable named loc? a. loc = amount.contains(","); b. loc = amount.substr(","); c.
If the msg variable contains the string “Happy holidays”, what will the location = msg.find("Day", 0); statement assign to the location variable? a. –1 b. 0 c. 10 d. 11
A _____________________ is a single item of information about a person, place, or thing. a. Field b. File c. Record d. None of the above
Follow the instructions for starting C++ and viewing the SwatTheBugs37.cpp file, which is contained in either the Cpp8\Chap13\SwatTheBugs37 Project folder or the Cpp8\Chap13 folder. (Depending on
In this exercise, you modify the program from Lab 13-2. If necessary, create a new project named Advanced35 Project and save it in the Cpp8\Chap13 folder. Also create a new source file named
If necessary, create a new project named Advanced34 Project and save it in the Cpp8\ Chap13 folder. Also create a new source file named Advanced34.cpp. Create a program that allows the user to enter
If necessary, create a new project named Advanced28 Project and save it in the Cpp8\Chap13 folder. Also create a new source file named Advanced28.cpp. Write a program that determines whether the user
If necessary, create a new project named Introductory21 Project and save it in the Cpp8\Chap13 folder. Also create a new source file named Introductory21.cpp. Write a program that allows the user to
In this exercise, you modify the program from Lab 13-2. If necessary, create a new project named Intermediate27 Project and save it in the Cpp8\Chap13 folder. Also create a new source file named
If necessary, create a new project named Intermediate26 Project and save it in the Cpp8\Chap13 folder. Also create a new source file named Intermediate26.cpp. Write a program that allows the user to
If necessary, create a new project named Intermediate25 Project and save it in the Cpp8\Chap13 folder. Also create a new source file named Intermediate25.cpp. Write a program that accepts a string of
If necessary, create a new project named Intermediate23 Project and save it in the Cpp8\Chap13 folder. Also create a new source file named Intermediate23.cpp. Write a program that displays the color
If necessary, create a new project named Introductory20 Project and save it in the Cpp8\Chap13 folder. Also create a new source file named Introductory20.cpp. Write a program that displays the
Correct the following statement, which should change the contents of the day variable from “731” to “7/31”: day = day.insert(2, "/");.
A string variable named amount contains a string that has zero or more commas. Write the C++ code to count the number of commas in the string. Assign the result to an int variable named numCommas.
The total and dollars variables are string variables. Write the C++ code that uses the assign function to assign 10 asterisks to the total variable. The code should then concatenate the contents of
Write a C++ statement that searches for the period in a string variable named amount and then assigns the location of the period to an int variable named location. Begin the search with the first
Write the C++ code to determine whether the address variable contains the street name “Grove Street”. Begin the search with the fifth character in the address variable and assign the result to an
Write the C++ code that uses the substr function to determine whether the string stored in the rate variable ends with the percent sign. If it does, the code should use the replace function to remove
The amount variable contains the string “3,123,560”. Write the C++ code to remove the commas from the contents of the variable.
Write a C++ statement to change the contents of the word variable from “mouse” to “mouth”
Write a C++ statement to change the contents of the word variable from “mend” to “amend”
The part variable contains the string “ABCD34G”. Write a C++ statement that assigns the 34 in the part variable to a string variable named code.
Write a C++ statement that assigns the first four characters in a string variable named address to a string variable named streetNum.
Write a C++ statement that replaces the first character in a string variable named code with the letter B.
Which of the following statements changes the contents of the word variable from “men” to “mean”? a. word.addTo(2, "a"); b. word.insert(2, "a"); c. word.insert(3, "a"); d.
Which of the following statements assigns the first three characters in the part variable to the code variable? a. code = part.assign(0, 3); b. code = part.substr(0, 3); c. code =
Which of the following determines whether the string stored in the part variable ends with the letter B? a. if (part.ends("B")) b. if (part.endswith("B") c. if
Which of the following determines whether the string stored in the part variable begins with the letter A? a. if (part.begins("A")) b. if (part.beginswith("A")) c. if (part.substr(0,
What is the subscript of the first character contained in a string variable? a. 0 (zero) b. 1 (one)
If the state variable contains the two letters MI followed by three spaces, which of the following statements will remove the three spaces from the variable’s contents? a. state.erase("
If the amount variable contains the string “$56.55”, which of the following statements will remove the dollar sign from the variable’s contents? a. amount.erase("$"); b.
Which of the following should a program use to store the name of any city in a string variable named cityName? a. cin >> cityName; b. cin(cityName);c. getline(cityName, cin); d.
Showing 1 - 100
of 378
1
2
3
4