New Semester
Started
Get
50% OFF
Study Help!
--h --m --s
Claim Now
Question Answers
Textbooks
Find textbooks, questions and answers
Oops, something went wrong!
Change your search query and then try again
S
Books
FREE
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
Tutors
Online Tutors
Find a Tutor
Hire a Tutor
Become a Tutor
AI Tutor
AI Study Planner
NEW
Sell Books
Search
Search
Sign In
Register
study help
computer science
systems analysis design
C# Programming From Problem Analysis To Program Design 5th Edition Barbara Doyle - Solutions
Given the Employee class shown below, which of the following would be the most appropriate heading for its default constructor?public class Employee {a. public void Employee( )b. public Employee( )c. static Employee( )d. private void Employee( )e. private Employee( )
Instance variables are the same as:a. private member datab. local variablesc. propertiesd. argumentse. parameters
What operator is used to instantiate the class?a. methodb. plus symbolc. ToString( )d. newe. equal symbol
Which of the following is a valid overloaded method for CalculateAvg( )?int CalculateAvg(int val1, int val2)a. void CalculateAvg(int val1, int val2)b. int CalculateAvg(int val1, int val2)c. int CalculateAvg( )d. double CalculateAvg(int val1, int val2)e. int CalculateAverage(int val2, int val1)
Properties are associated with the _____ of the class while methods are affiliated with the _____ of the class.a. activity, fieldsb. accessors, mutatorsc. objects, instancesd. data, behaviore. behavior, data
Which of the following is one of the user-defined methods inherited from the object class?a. ToString( )b. Main( )c. CalculateAvg( )d. EqualsHashCode( )e. TypeHashCode( )
Which of the following would be the most appropriate way to invoke the CalculateAvg( ) method found in the Student class if an object named gradStudent had been instantiated from the class?public double CalculateAvg( )a. gradStudent = CalculateAvg( );b. answer = Student.CalculateAvg( );c.
Which of the following identifiers follows the standard naming convention for naming a class?a. Calculate Final Gradeb. MilesPerGallonc. Studentd. Reportse. Employees
Which of the following modifiers is the most restrictive?a. privateb. staticc. publicd. internale. protected
Objects are instances of:a. data membersb. parametersc. propertiesd. methodse. classes
Properties are defined with _____ access mode.a. privateb. staticc. publicd. voide. protected
Write an application that helps landowners determine what their property tax will be for the current year. Taxes are based on the property’s assessed value and the annual millage rate. The established millage rate for the current year is $10.03 per $1000 value. Homeowners are given a $25,000
Write a program that calculates and prints the take-home pay for a commissioned sales employee. Allow the user to enter values for the name of the employee and the sales amount for the week. Employees receive 7% of the total sales as their commission. Use 18% as the federal tax rate.Retirement
Write a program that computes the amount of money the computer club will receive from proceeds of their granola bar sales project. Allow the user to enter the number of cases sold and the sale price per bar. Each case contains 12 bars; each case is purchased at $5.00 per case from a local vendor.
Write a program that can be used to determine the tip amount that should be added to a restaurant charge. Allow the user to input the restaurant charge, before taxes. Produce output showing the calculated values including the total amount due for both 15% and the 20% tips.Tax of 9% should be added
Write a program that can be used to convert meters into feet and inches.Allow the user to enter a metric meter value in a method. Provide input, calculation, and display methods. Be sure to provide labels for values and number align them.
Write a program that converts a temperature given in Fahrenheit into Celsius. Allow the user to enter values for the original Fahrenheit value.Display the original temperature and the formatted converted value.Number align values. Use appropriate methods for entering, calculating, and outputting
Design an application using methods that convert an integer number of seconds into an equivalent number of hours, minutes, and seconds.Use methods for entering the initial seconds, performing the computations, and displaying the results. You should have separate methods for each computation.
Write an application that allows a user to input the height and width of a rectangle. It should output the area and perimeter of the rectangle.Use methods for entering the values, performing the computations, and displaying the results. Results should be formatted with one position to the right of
Write an application that includes two additional methods in addition to the Main( ) method. One method should return a string consisting of four or five lines of information about your school. The other method should return a string consisting of asterisks. First call the method that returns the
Design a message display application which will allow users to enter their name and favorite saying. Begin by providing instructions to the user about what the application will be requesting. Include one method for input. Invoke the input method two times. First call the method asking for the
The following program has several syntax errors as well as style inconsistencies.Identify a minimum of five syntax errors and three style violations. For an added challenge, correct all errors./****************************************using System;namespace ErrorExample{class ErrorExample{static
What will be produced from the following predefined Math class method calls?a. WriteLine(Math.Pow(4,3));b. WriteLine(Math.Sqrt(81));c. WriteLine(Math.Min(−56, 56));
Write statements to invoke each of the methods defined above in Exercise 22.
Write methods to do the following:a. Display three full lines of asterisks on the screen.b. Accept as an argument your name, and display that value along with an appropriate label.c. Accept two floating-point values as arguments. Display the values formatted with three digits to the right of the
Use the following method headings to answer the questions below:static int DetermineResult(int value1, ref double value2)static void DisplayResult(int value1, double value2)static int GetValue( )a. How many parameters does each method have?b. What is the return type for each of the methods?c. Which
Given the following task, which would be the most appropriate method heading?Results have been calculated for taxAmount and totalSales. Write a method heading that accepts these values as input for display purposes.a. static DisplayResults( )b. DisplayResults(double)c. static void DisplayResults(
Given the following task, which would be the most appropriate method heading?A method receives three whole numbers as input. The values represent grades. They should be unchangeable in the method. The method should return the average with a fractional component. a. b. static double DetermineGrade
Given the following task, which would be the most appropriate method heading?A method displays three integer values formatted with currency.a. static int int int DisplayValues( )b. static int DisplayValues(int v1, int v2, int v3)c. static void DisplayValues( )d. static void DisplayValues(int v1:C,
Which of the following is not a modifier in C#?a. intb. privatec. publicd. statice. protected
If a method is to be used to enter two values that will be used later in the program, which of the following would be the most appropriate heading and call?a. heading: void InputValues(out int val1, out int val2) call:InputValues(out val1, out val2);b. heading: void InputValues(int val1, int
Given the following method definition, what would be a valid call? The variable someIntValue is defined as an int.static int GetData(out int aValue, ref int bValue)a. someIntValue = GetData(aValue, bValue);b. someIntValue = GetData(out aValue, ref bValue);c. someIntValue = GetData(out, ref);d.
Which of the following would be a valid call to a method defined as shown below?static void InitializeValues( )a. void InitializeValues( );b. WriteLine(InitializeValues( ));c. int returnValue = InitializeValues( );d. InitializeValues( );e. InitializeValues(aVariable );
If you follow the standard C# naming conventions, the local variable names:a. follow the Camel case convention.b. should use an action verb phrase.c. begin with an uppercase character.d. are named like namespace identifiers.e. are defined inside parenthesis of the method header.
The following is probably an example of a _________.DisplayInstructions( );a. call to a value-returning methodb. call to a void methodc. method headingd. method definitione. call to a method with multiple arguments
Given the call to the method ComputeCost( ) shown below, which of the following would be the most appropriate heading for the method? The variable someValue is declared as an int.someValue = ComputeCost(27.3);a. static void ComputeCost(double aValue)b. static int ComputeCost( )c. static double
Variables needed only inside a method should be defined as:a. private member datab. local variablesc. propertiesd. argumentse. parameters
What is the signature of the following method?void SetNoOfSquareYards(double squareYards){noOfSquareYards = squareYards;}a. void SetNoOfSquareYards(double squareYards)b. SetNoOfSquareYards(double squareYards)c. SetNoOfSquareYardsd. void SetNoOfSquareYards(double)e. SetNoOfSquareYards(double)
Which of the following is a valid method call for DetermineHighestScore?void DetermineHighestScore(int val1, int val2)a. void DetermineHighestScore(int val1, int val2)b. DetermineScore(int val1, int val2)c. DetermineHighestScore(val1, val2)d. DetermineHighestScore(2, 3.5)e. GetHighestScore( )
After completing the called method’s body, control is returned:a. back to the location in the calling method that made the call.b. to the last statement in the method that made the call.c. to the first statement in the method that made the call.d. to the Main( ) method.e. to the method that is
Given the following statement, what would be the best heading for the DetermineAnswer( ) method?int aValue, result;result = DetermineAnswer(27.83, aValue);a. void DetermineAnswer(27.83, aValue)b. int DetermineAnswer( )c. int DetermineAnswer(double v1, int v2)d. double int DetermineAnswer( )e. void
Which of the following would be the most appropriate way to invoke the predefined Floor( ) method found in the Math class?static double Floor (double)a. answer = Floor(87.2);b. answer = Math.Floor(87.2);c. Floor(87.2);d. Math.Floor(double);e. Math.Floor(87.2);
Which of the following identifiers follows the standard naming convention for a method?a. Calculate Final Gradeb. MilesPerGallonc. InputValued. Reporte. Method1
Which of the following modifiers is the least restrictive?a. privateb. staticc. publicd. internale. protected
Functions or modules found in other languages are similar to __________ in C#.a. modifiersb. parametersc. argumentsd. methodse. classes
Which of the following is placed in a method heading to indicate that no value will be returned?a. noReturnb. voidc. argumentsd. statice. public
In countries using the metric system, many products are sold by grams and kilograms as opposed to pounds and ounces. Write an application that converts grams to pounds and will display the price of the product by pound. Test your application by doing a compile-time initialization of Poutine, a
Write a program that computes the amount of money the computer club will receive from the proceeds of their granola sales. They sell the granola bars for $1.50 per bar. Purchases for the granola are in cases, with each case having 100 bars. Each case costs $100.00. They are required to give the
Write a program that computes a weighted average giving the following weights.Homework: 10%Projects: 35%Quizzes: 10%Exams: 30%Final Exam: 15%Do a compile-time initialization with the following values:Homework: 97; Projects: 82; Quizzes: 60; Exams: 75; Final Exam 80.Display all values, including the
Write a tip calculating applications that can be used to determine what the tip and final charges would be given a total bill charge. Display the tip for 15% and 20% along with totals for each of the percentages. On output, show the original bill charge and each of the tip calculations with a final
Write a program that calculates and prints the take-home pay for a commissioned sales employee. Perform a compile-time initialization and store the name of Joshua Montain in a variable called employeeName.For practice working with the decimal data type, declare all monetary values as decimal.
Write a program that shows the formatted retail price of shirts when there is a 15% markdown. Test the program by performing a compiletime initialization with an item labeled “Open Collar Running Shirt,”which has a wholesale price of $41.00. How much savings is expected with the markdown?
Write a program that prints the number of quarters, dimes, nickels, and pennies that a customer should get back as change. Declare and initialize all memory locations as integers. On output, show the original change amount as a monetary amount, with two positions to the right of the decimal. Run
Write a program that computes the average of five exam scores. Declare and perform a compile-time initialization with the five exam values.Declare integer memory locations for the exam values. Use an integer constant to define the number of scores. Print all scores. The average value should be
Design an application that converts miles into feet and its equivalent metric kilometer measurement. Declare and initialize miles to 4.5.Show your miles and kilometers formatted with two positions to the right of the decimal. Feet should both be shown with no positions to the right of the decimal
Write a program that converts a temperature given in Celsius into Fahrenheit. Test the program by performing a compile-time initialization of 32 for the original Celsius value. Display the values number aligned. The original temperature should show no digits after the decimal. One position
The following program has several syntax errors as well as style inconsistencies.Correct the syntax errors and identify the style violations. namespace Chapter2 { { } class converter { static void main( CONST int inches = 12; int x 100; y = 10; float z = 22.45; double ans; ans inches+z*x*y;
Explain the width specifier. Be sure to include both positive and negative numbers with your explanation.
Explain how a variable differs from a constant.
What will be the output from each of the following statements?a. Write(“Result is {0:c}”, 67);b. Write(“Number {0:f0} is {1:c}”, 1, 3);c. Write(“{0,-10:f0}–{1,10:c}”, 1, 3 * 2 );d. Write(“{0:f0} result “ + “xyz {1:f2}”, 1, 25);
Suppose x, y, and z are double variables and x = 2.5, y = 6.9, and z = 10.0. What will be in the memory locations of each of the variables after each of the following statements is executed? (For each exercise, use the original declaration.) X a. z* = y++ % 7; b. x=z/3*--y; c. z /= (int)y/x; d. z =
Suppose x, y, and z are int variables and x = 2, y = 6, and z = 10.What will be in the memory locations of each of the variables after each of the following statements is executed? (For each exercise, use the original declaration.) a. z += ++y % 2; b.xyz/2 x * z; c. x %-z-y*2; d. y (z-y) 2+ --y; X
For each of the following declarations, write an appropriate compiletime initialization.a. counter for the number of correct responses begins with zerob. amount of money you owe on a credit card is zeroc. name of the hometown or the city where your school is locatedd. grade on the next exam is
For each of the following, declare a variable using the best choice for data type.a. a counter for the number of correct responsesb. the amount of money you owe on a credit cardc. the name of your hometownd. the grade you hope to obtain on the next exame. the grade you hope is recorded at the end
Which of the following are valid identifiers? If they are invalid, indicate why.a. intValueb. value#1c. the first valued. _value1e. AVALUE
Indicate the order of operations for the following assignment statements by placing a number under the assignment operator, as illustrated in Figure 2-13.a. ans = value1 + value2 * value3 − (value4 + 20 / 5 % 2) * 7;b. ans += value1-- * 10;c. ans = (((value1 + 7) − 6 * value2) / 2);d. ans =
Which of the following formats 86 to display with two digits to the right of the decimal?a. {0:C}b. {0:c}c. {0:f2}d. all of the abovee. none of the above
What is stored in ans as a result of the arithmetic expression, given the following declarations?int ans = 10, v1 = 5, v2 = 7, v3 = 18;ans += v1 + 10 (v2 / 5) + v3 / v2;a. 18b. 32c. 28d. 30e. none of the above
What is stored in ans as a result of the arithmetic expression, given the following declarations?int ans = 0, v1 = 10, v2 = 19;ans = v2 % v1++;a. 1.8b. 9c. 8d. 2e. none of the above
Which statement increases the result by 15?a. 15 += result;b. 15 =+ result;c. result =+ 15;d. result += 15;e. result = 15 +;
Adding the keyword const to a declaration:a. places a value in memory that cannot be changed.b. declares variables of the constant type.c. must be done by placing it after the identifier in the declaration.d. can only be done with the integral types.e. is prohibited in C#.
What would be an appropriate declaration for a memory location to be used as a flag to indicate whether a value has reached its upper limit?a. int upperLimit;b. upperLimit reached;c. bool upperLimit;d. Boolean upperLimit;e. string upperLimit;
An object of the int class is:a. 147.98b. 417c. int classd. type objecte. type integral
Types are implemented in C# using:a. classesb. typesc. objectsd. namespacese. programs
Which of the following is a valid declaration for a variable to store the name of this textbook?a. char name of book;b. string nameOfBook;c. boolean nameOfBook;d. char bookName;e. char book Name;
One of primary differences between float, double, and decimal is:a. float is used to represent more significant digits.b. double is normally used with large monetary values.c. decimal is not used to display negative values.d. double does not require suffixing a numeric literal with a value such as
Which of the following is a reserved keyword?a. Consoleb. Mainc. usingd. Systeme. all of the above
The character that cannot be used with an identifier is:a. –b. $c. *d. #e. all of the above
Which of the following is a reference type?a. intb. boolc. stringd. decimale. integral
The number 768.6 is an example of a type.a. boolb. integralc. floating-pointd. structe. int
Which of the following is a valid identifier?a. intb. jersey girlc. 6Valuesd. sampleValuee. value-1
Write a program that displays your initials in block characters so that each letter is made up of the character that it represents. Output should consist of at least 10 rows or lines and all initials must appear together in those rows. The output should be displayed with white background and black
Create an application that displays several patterns. You may use any character of your choice to construct the patterns. Design your solution to include at least three different patterns and display the three patterns on the same row. The output should be displayed with white background and black
Hangman is a favorite childhood game. Design the stick figure for this game and produce a printed listing with your stickman. One possible design follows. You may implement this design or develop an improved version; however, you must include legs and arms that use the backslash symbol as part of
Produce a listing containing information about you. Include items such as your name, hometown, major, hobby, and/or favorite activity. Label each piece of information, place each of the items on separate lines, and place a single backslash (\) after each entry. Begin and end the entire listing with
Create an application that produces three different outputs using the same phrase. Select your own favorite popular saying for the phrase.The phrase should first be displayed on a single line. The output should be displayed with white background and black text. Use at least three Write( )
Flags are a symbol of unity and invoke special meaning to their followers.Create a design for a flag and write a program that displays your design. The output should be displayed with white background and black text. One possible design
First develop a prototype and then write a program that displays the name of the programming language discussed in this text. The output should be displayed with white background and black text. You should be more creative, but one possible design is given here. ## ## ## ############## ############
Create an application that displays an X as output. Use any characters of your choosing when you design your prototype. The output should be displayed with white background and black text. One possible design is given here.For an added challenge, use mostly tabs and newline characters as part of
Develop an application that produces a banner containing information about your project. Items you might include are your programming assignment number, name, date submitted, and the purpose of the application. Label each item. These are items you might want to include as internal documentation on
Write a program that displays the traditional Hello World message on the screen but adds your introduction. The output should be displayed with white background and black text. One possible design is shown here.Hello World! My name is Tyler Howard!For an added challenge, also display your message
Identify the syntax error(s) (if any) in the following:Line 1 using System Line 2 namesspace ExerciseI Line 3 {Line 4 Problem2 Line 5 {Line 6 static Main( )Line 7 {Line 8 console.write("ok")Line 9 }Line 10 }Line 11 }
Using the program segment in Exercise #22, identify line number(s) in which each of the following can be found:a. method invocationb. namespacec. class named. argument to a methode. identifier
What must be changed in the segment of code in Exercise #22 to cause all of the output to be displayed on one line?
What is produced when you run the following application?Line 1 using System;Line 2 using System.Console;Line 3 namespace ExerciseI Line 4 {Line 5 class Problem2 Line 6 {Line 7 static void Main( )Line 8 {Line 9 Write("Go ");Line 10 Write("Forth ");Line 11 WriteLine("and DO");Line 12 Write("Awesome
Identify one syntax error that might occur when you type Example 1-1 into an editor. Identify one logic error that might occur.
Which of the following is a call to a method?a. Console.Write;b. Console.Write["ok"];c. Write.Console("ok");d. Console.Write("ok");e. none of the above
Which escape sequence can be used to indicate that the cursor should advance to the next line?a. newlineb. escape nextc. d. ewlinee.
To see the results of an application, you _____ the code.a. compileb. JITc. executed. edite. desk check
What is the name of the feature in Visual Studio that displays in a scrollable list all available methods and properties when the dot is typed after an object name?a. Helpb. Rotorc. Monod. IntelliSensee. ToolTip
Showing 200 - 300
of 5433
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Last
Step by Step Answers