Answer:
View Images.
Image1 = the code
Image2 = testcase 1
Image3 = testcase 2
Image4 = testcase 3
Enter the length of a side: 5
***** *****
***** * *
***** * *
***** * *
***** *****
Answer:
Here is the JAVA program.
import java.util.Scanner; //Scanner class to take input from user
public class HollowFilledSquare {
public static void main(String[] args) { //start of main() function body
Scanner sc= new Scanner(System.in); // Scanner class object
System.out.print("Enter an integer to display a filled and hollow square "); //prompts user to enter an integer
int n = sc.nextInt(); // reads integer input from the user
StringBuilder filled = new StringBuilder(n);
// creates objects filled and hollow of class StringBuilder
StringBuilder hollow = new StringBuilder(n);
for (int i = 1; i <= n; i++) { // outer loop for length of the square
for (int j = 1; j <= n; j++) { // inner loop for width of square
filled.append("*"); //displays asterisks
if (i == 1 || i == n || j == 1 || j == n) // condition to display stars
{hollow.append("*");}
else
{ hollow.append(" "); } } // to display empty spaces
System.out.println(filled + " " + hollow);
// places hollow and filled squares next to each other
filled. delete(0, filled.length());
//removes characters from 0 to the length of filled square
hollow. delete(0, hollow.length());
//removes characters from 0 to the length of hollow square } } }
Explanation:
The program first prompts the user to enter an integer. It uses outer loop for length of the square and inner loop for width of square in order to display the asterisks. append () function is used to display the sequence of asterisks. delete () function removes the asterisks from the sequence of asterisks. String Builder is a class used for to create a string of n characters. It basically works like String but this is used to create modifiable objects.
The screen shot of the code along with the output is attached.
A Python program can be written to read an integer that is then used to print out two squares of that side length with asterisks, one filled and one hollow. The provided Python code uses nested loops and conditionals to generate the squares accurately.
To complete your request, we would need to write a program to read an integer input and utilize this integer value to generate two squares with asterisks, one filled and one hollow. Here is a simple Python program:
def print_squares(n):This program first prints a filled square and a hollow square using conditionals to distinguish between the edge and inner positions of the squares.
#SPJ3
b. Surge suppressor
c. CRT
d. UPS
Answer: A) Battery backup
Explanation:
A battery backup are used to provide the source of power backup to various hardware components and desktop computers. In many cases, the devices are plugged into UPS ( uninterruptible power supply) for backup power and it is also depend upon the size of the UPS.
All the battery backups are located inside so that is why, the devices are heavy in weight. Usually, the battery backup front required additional button for performing various functions.
And the battery backup devices are manufacture by using the varying degree of backup abilities.
Answer:
It can be both
Explanation:
This all depends on how that e commerce is planning on handling their deliveries. Taking Amazon as an example, they're probably top customers from FedEx and UPS (and others as well), which at a very beginning this has shown a great opportunity for these companies. However, Amazon has started to show interest in starting their own delivery which also poses a huge risk.
Answer:
By given the right speech as much as the answers must be
Explanation:
By given the right speech as much as the answers must be
A.print(5 // totalItems)
B.print(totalItems // 5)
C.print(totalItems(5) )
D.print(5(totalitems) )
Answer:
B. Print Totalltems // 5
Explanation:
Well, if you learn how to create bundles on Amazon, you can eliminate the competition, set your price, and offer customers a product they’ll absolutely love.