Answer:
Option D The negative number entered to signal no more input is included in the product
Explanation:
Given the code as follows:
- int k = 0;
- int prod = 1;
- while (k>=0)
- {
- System.out.println("Enter a number: ");
- k= readInt( );
- prod = prod*k;
- }
- System.out.println("product: "+prod);
The line 7 is a logical error. Based on the while condition in Line 3, the loop shall be terminated if k smaller than zero (negative value). So negative value is a sentinel value of this while loop. However, if user enter the negative number to k, the sentinel value itself will be multiplied with prod in next line (Line 7) which result inaccurate prod value.
The correct code should be
- int k = 0;
- int prod = 1;
- while (k>=0)
- {
- prod = prod*k;
- System.out.println("Enter a number: ");
- k= readInt( );
- }
- System.out.println("product: "+prod);
Mark is gonna be the answer for question 1
Answer:
Smart Guides
Explanation:
When moving pictures and graphics around on the slide you can use SMART GUIDES to help you line things up on your slide.
To access Smar Guides, clicking and dragging the object will automatically bring Smart Guides, then a user can align and space the object accordingly.
Other options for aligning and spacing in Microsoft PowerPoint are:
1. Align Object: this can be assessed through the Format tab
2. Gridlines: this can be assessed through View Tab
3. Guides: this can be assessed from View Tab
4. Using keys Arrows to move the object around
Answer: C) P2P networks are only found in homes
Explanation:
It should be noted that for a peer to peer network, there is no centralized authority as the devices that are connected can all share their resources with one another. Also, computers in a P2P network belong to a workgroup.
Therefore, the option that P2P networks are only found in homes is not true as it can be found anywhere.