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 Tutor
New
Search
Search
Sign In
Register
study help
computer science
visual c how program
Questions and Answers of
Visual C How Program
Some scientists believe that carbon emissions, especially from the burning of fossil fuels, contribute significantly to global warming and that this can be combatted if individuals take steps to
Small airline has just purchased a computer for its new automated reservations system. You have been asked to develop the new system. You’re to write an app to assign seats on each flight of the
Investigate other compute-intensive calculations, then modify the example of Fig. 23.1 to perform a different compute-intensive calculation asynchronously.
Modify the example of Fig. 23.3 to process the results by using the array returned by the Task produced by Task method WhenAll.
Investigate other web services at a site like http://www.programmableweb.com. Locate a REST web service that returns XML, then modify the example of Fig. 23.4 to invoke the web service asynchronously
You may have noticed that the prime-number example in Fig. 23.6 produces prime numbers rapidly. The asynchronous task in the example is probably not compute bound, but rather I/O bound—that is, the
Visit https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes to learn more about the Sieve of Eratosthenes. The algorithm as implemented in Fig. 23.6 is inefficient, because it keeps eliminating
Develop a C# app that will determine the gross pay for each of three employees. The company pays straight time for the first 40 hours worked by each employee and time-and-a-half for all hours worked
A large company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who sells $5,000 worth of
Develop a C# app that will determine whether any of several department- store customers has exceeded the credit limit on a charge account. For each customer, the following facts are available:a)
Drivers are concerned with the mileage their automobiles get. One driver has kept track of several tankfuls of gasoline by recording the miles driven and gallons used for each tankful. Develop a C#
Create the GUI in Fig. 14.2 (you do not have to provide functionality).Figure 14.2 Printer GUI Ok Printer. Bugalicious X9000 O Image O Selection Cancel Text O Current page Code ComboBox Setup.
The C# compiler always associates an else with the immediately preceding if unless told to do otherwise by the placement of braces ({ and }). This behavior can lead to what is referred to as the
Create the GUI in Fig. 14.1 (you do not have to provide functionality).Figure 14.1 Calculator GUI 4 1 9, 6. 3. 2.
(True/False) You can update a GUI from any thread of execution. If false, explain why.
Does the async and await mechanism create new threads?
Suppose you program an app with two compute-intensive tasks that run on one core of a dual-core system. Then, suppose you program the app so that the two compute-intensive tasks run asynchronously in
What is the key advantage of programming your apps for multicore systems?
What does it mean to process tasks asynchronously?
State whether each of the following is true or false. If false, explain why.a) Providing the same value for a foreign key in multiple rows causes the DBMS to report an error.b) Providing a
Fill in the blanks in each of the following statements:a) A table in a relational database consists of _________and _________in which values are stored.b) The _________uniquely identifies each row in
Explain briefly the operation of each of the following methods and properties of interface IDictionary, which both Dictionary and Sorted-Dictionary implement:a) Addb) Keysc) Valuesd) Contains Key
Explain briefly the operation of each of the following enumerator related methods:a) Get Enumeratorb) Currentc) Move Next
Describe each of the following:a) ICollectionb) Arrayc) IListd) Load factore) Hash-table collisionf) Space/time trade-off in hashingg) Dictionary
State whether each of the following is true or false. If false, explain why.a) Functional programming’s filter, map and reduce operations correspond to the IEnumerable extension methods Where,
Fill in the blanks in each of the following statements:a) A(n) ________is used to iterate through a collection but cannot remove elements from the collection during the iteration.b) IEnumerator
Write a simple generic version of method IsEqualTo that compares its two arguments with the Equals method, and returns true if they’re equal and false otherwise. Use this generic method in a
Explain why a C# program might use the statement var workerlist = new Array();
The compiler performs a matching process to determine which method to call when a method is invoked. Under what circumstances does an attempt to make a match result in a compile-time error?
How can generic methods be overloaded?
Explain the use of the following notation in a C# program:public class Array
For the class Craps in Fig. 7.8, state the scope of each of the following entities:a) The variable random Numbers.b) The variable die 1.c) The method Roll Dice.d) The method Main.e) The variable sum
Describe in general how you would remove any continue statement from a loop in an app and replace it with some structured equivalent. Use the technique you develop here to remove the continue
Fill in the blanks in each of the following:a) _______Enable you to specify, with a single method declaration, a set of related methods; _______enable you to specify, with a single class declaration,
State whether each of the following is true or false. If false, explain why.a) A generic method cannot have the same method name as a non-generic method.b) All generic method declarations have a
Fill in the blanks in each of the following statements:a) A(n) ___________class is used to define nodes that form dynamic data structures, which can grow and shrink at execution time.b) Operator
State whether each of the following is true or false. If false, explain why.a) In a queue, the first item to be added is the last item to be removed.b) Trees can have no more than two child nodes per
Implement the bubble sort—another simple, yet inefficient, sorting technique. It’s called bubble sort or sinking sort because smaller values gradually “bubble” their way to the top of the
In the text, we say that after the merge sort splits the array into two subarrays, it then sorts these two subarrays and merges them. Why might someone be puzzled by our statement that “it then
In what sense is the insertion sort superior to the merge sort? In what sense is the merge sort superior to the insertion sort?
What key aspect of both the binary search and the merge sort accounts for the logarithmic portion of their respective Big Os?
Fill in the blanks in each of the following statements:a) A selection sort app would take approximately __________times as long to run on a 128-element array as on a 32-element array.b) The
Fill in the blanks in each of the following statements:a) The _________namespace contains the BinaryFormatter class.b) StreamReader method _________reads a line of text from a file.c) StreamWriter
State whether each of the following is true or false. If false, explain why.a) You cannot instantiate objects of type Stream.b) Typically, a sequential file stores records in order by the record-key
Fill in the blanks in each of the following statements:a) To concatenate strings, use operator _____________, StringBuilder method _____________or string method _____________.b)
State whether each of the following is true or false. If false, explain why.a) When strings are compared with ==, the result is true if the strings contain the same values.b) A string can be modified
Fill in the blanks in each of the following statements:a) Method ____________of class Process can open files and web pages, similar to the Run... command in Windows.b) If more elements appear in a
State whether each of the following is true or false. If false, explain why.a) Menus provide groups of related classes.b) Menu items can display ComboBoxes, checkmarks and access shortcuts.c) The
Fill in the blanks in each of the following statements:a) The active control is said to have the ______.b) The Form acts as a(n) ______for the controls that are added.c) GUIs are ______driven.d)
State whether each of the following is true or false. If false, explain why.a) The Key Data property includes data about modifier keys.b) A Form is a container.c) All Forms, components and controls
Exceptions can be used to indicate problems that occur when an object is being constructed. Write a program that shows a constructor passing information about constructor failure to an exception
State whether each of the following is true or false. If false, explain why.a) Exceptions always are handled in the method that initially detects the exception.b) User-defined exception classes
Fill in the blanks in each of the following statements:a) A method is said to __________an exception when it detects that a problem has occurred.b) When present, the __________block associated with a
Compare and contrast abstract classes and interfaces. Why would you use an abstract class? Why would you use an interface?
Discuss four ways in which you can assign base-class and derived-class references to variables of base-class and derived-class types.
How does polymorphism promote extensibility?
What are abstract methods? Describe the circumstances in which an abstract method would be appropriate.
A derived class can inherit “interface” or “implementation” from a base class. How do inheritance hierarchies designed for inheriting interface differ from those designed for inheriting
How does polymorphism enable you to program “in the general” rather than “in the specific”? Discuss the key advantages of programming “in the general.”
State whether each of the statements that follows is true or false. If false, explain why.a) It’s possible to treat base-class objects and derived-class objects similarly.b) All methods in an
Fill in the blanks in each of the following statements:a) If a class contains at least one abstract method, it must be declared as a(n) _______class.b) Classes from which objects can be instantiated
Some programmers prefer not to use protected access, because they believe it breaks the encapsulation of the base class. Discuss the relative merits of using protected access vs. using private access
The world of shapes is much richer than the shapes included in the inheritance hierarchy of Fig. 11.3. Write down all the shapes you can think of—both two dimensional and three-dimensional—and
Discuss the ways in which inheritance promotes software reuse, saves time during app development and helps prevent errors.
State whether each of the following is true or false. If a statement is false, explain why.a) Base-class constructors are not inherited by derived classes.b) A has-a relationship is implemented via
Fill in the blanks in each of the following statements:a) ________is a form of software reusability in which new classes acquire the members of existing classes and enhance those classes with new
Suppose class Book defines properties Title, Author and Year. Use an object initializer to create an object of class Book and initialize its properties.
Fill in the blanks in each of the following statements:a) The public members of a class are also known as the class’s ________or ________.b) If a method contains a local variable with the same name
State whether each of the following is true or false. If false, explain why.a) The orderby clause in a LINQ query can sort only in ascending order.b) LINQ queries can be used on both arrays and
Fill in the blanks in each of the following statements:a) Use the _________property of the List class to find the number of elements in the List.b) The LINQ _________clause is used for filtering.c)
Lets create a computer called the Simpletron. As its name implies, its a simple machine, but powerful. The Simpletron runs programs written in the only language it directly
List the elements of the three-by-five jagged array sales in the order inwhich they’re set to 0 by the following code segment:for (var row = 0; row < sales.Length; ++row){for (var col = 0; col
Write statements that perform the following one-dimensional-array operations:a) Set the three elements of integer array counts to 0.b) Add 1 to each of the four elements of integer array bonus.c)
Consider the two-by-three rectangular integer array t.a) Write a statement that declares t and creates the array.b) How many rows does t have?c) How many columns does t have?d) How many elements does
Write C# statements to accomplish each of the following tasks:a) Display the value of the element of character array f with index 6.b) Initialize each of the five elements of one-dimensional integer
Determine whether each of the following is true or false. If false, explain why.a) To refer to a particular location or element within an array, we specify the name of the array’s variable and the
Fill in the blanks in each of the following statements:a) One-dimensional array p contains four elements. The names of those elements are _______, _______, _______and _______.b) Naming an array’s
Find and correct the error in each of the following code segments:a) const int ArraySize = 5;ArraySize = 10;b) Assume var b = new int[10];for (var i = 0; i <= b.Length; ++i){b[i] = 1;}c) Assume
Perform the following tasks for an array called table:a) Declare the variable and initialize it with a rectangular integer array that has three rows and three columns. Assume that constant ARRAY_SIZE
Perform the following tasks for an array called fractions:a) Declare constant ArraySize initialized to 10.b) Declare variable fractions which will reference an array with ArraySize elements of type
Determine whether each of the following is true or false. If false, explain why.a) A single array can store values of many different types.b) An array index should normally be of type float.c) An
Fill in the blank(s) in each of the following statements:a) Lists and tables of values can be stored in _______.b) An array is a group of _______(called elements) containing values that all
Find the error(s) in the following recursive method, and explain how to correct it:static int Sum(int n){if (n == 0){return 0;}else{return n + Sum(n);}}
What does the following method do?// Parameter b must be positive to prevent infinite recursion static int Mystery(int a, int b){if (b == 1){return a;}else{return a + Mystery(a, b - 1);}}
Modify the app of Exercise 7.30 to count the number of guesses the player makes. If the number is 10 or fewer, display Either you know the secret or you got lucky! If the player guesses the number in
For each of the following sets of integers, write a single statement that will display a number at random from the set. Assume Random random Numbers = new Random() has been defined and use the
Write statements that assign random integers to the variable n in the following ranges. Assume Random random Numbers = new Random() has been defined and use the two-parameter version of the method
Answer each of the following questions:a) What does it mean to choose numbers “at random”?b) Why is the Random class useful for simulating games of chance?c) Why is it often necessary to scale or
What is the value of the double variable x after each of the following statements is executed?a) x = Math.Abs(7.5);b) x = Math.Floor(7.5);c) x = Math.Abs(0.0);d) x = Math.Ceiling(0.0);e) x =
Write a complete C# app to prompt the user for the double radius of a sphere, and call method SphereVolume to calculate and display the volume of the sphere. Write an expression-bodied method
Find the error(s) in each of the following code segments. Explain how to correct the error.a) void G(){Console.WriteLine("Inside method G");void H(){Console.WriteLine("Inside method H");}}Correction:
Give the method header for each of the following methods:a) Method Hypotenuse, which takes two double-precision, floating-point arguments side1 and side2 and returns a double-precision,
Write an app that tests whether the examples of the Math class method calls shown in Fig. 7.2 actually produce the indicated results.
Fill in the blanks in each of the following statements:a) A method is invoked with a(n) _________.b) A variable known only within the method in which it’s declared is called a(n) _________.c)
What does the following code segment do?for (int i = 1; i <= 5; ++i){for (int j = 1; j <= 3; ++j){for (int k = 1; k <= 4; ++k){Console.Write('*');}Console.WriteLine();}Console.WriteLine();}
A criticism of the break statement and the continue statement (in a loop) is that each is unstructured. Actually, break and continue statements can always be replaced by structured statements,
Assume that i = 1, j = 2, k = 3 and m = 2. What does each of the following statements display?a) Console.WriteLine(i == 1);b) Console.WriteLine(j == 3);c) Console.WriteLine((i >= 1) && (j
What does the following app do? // Exercise 6.10 Solution: Printing.cs using System; class Printing { static void Main() 6 { for (int i - 1; i
Compare and contrast the break and continue statements.
Find and correct the error(s) in each of the following segments of code:a) For (i = 100, i >= 1, ++i){Console.WriteLine(i);}b) The following code should display whether integer value is odd or
Showing 1 - 100
of 187
1
2