answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mrrafil [7]
2 years ago
12

2.4: Star Pattern Write a program that displays the following pattern: * *** ***** ******* ***** *** * Output. Seven lines of ou

tput as follows: The first consists of 3 spaces followed by a star. The second line consists of 2 spaces followed by a 3 stars. The third consists of one space followed by 5 stars, and the fourth consists just of 7 stars. The fifth line is identical to third, th sixth to the second and the seventh to the first. CLASS NAMES. Your program class should be called StarPattern
Computers and Technology
1 answer:
adelina 88 [10]2 years ago
5 0

Answer:

// here is code in java.

public class NAMES

{

// main method

public static void main(String[] args)

{

int n=4;

// print the upper half

for(int a=1;a<=n;a++)

{

for(int b=1;b<=n-a;b++)

{

// print the spaces

System.out.print(" ");

}

// print the * of upper half

for(int x=1;x<=a*2-1;x++)

{

// print the *

System.out.print("*");

}

// print newline

System.out.println();

}

// print the lower half

for(int y=n-1;y>0;y--)

{

for(int z=1;z<=n-y;z++)

{

// print the spaces

System.out.print(" ");

}

for(int m=1;m<=y*2-1;m++)

{

// print the *

System.out.print("*");

}

// print newline

System.out.println();

}

}

}

Explanation:

Declare a variable "n" and initialize it with 4. First print the spaces (" ") of the upper half with the help of nested for loop.Then print the "*" of the upper half with for loop. Similarly print the lower half in revers order. This will print the required shape.

Output:

  *

 ***

*****

*******

*****

 ***

  *

You might be interested in
For multicore processors to be used effectively, computers must understand how to divide tasks into parts that can be distribute
AnnyKZ [126]

Answer: parallel processing

Explanation:

Parallel processing is the process by which the processor has the capacity to execute parallel instruction at the same time. This is possible only by assigning the different task to the different cores present in the cpu. So a cpu with multiple cores are able to process multiple task as the same time parallel.

8 0
2 years ago
While rendering the homepage of a website, it takes a lot of time due to the thread being blocked in processing JS/CSS. What are
jekas [21]

Answer:

a) Pick ONE OR MORE options Using code-splitting for JS files.

b) Compressing the JS files on the server-side

Explanation:

Javascript is a multi-purpose programming language, it is used in web development as a scripting language for programming the interactiveness of the web application.

Loading and running the script from the server can take a lot of time, so, the file is compressed and split for faster loading.

6 0
2 years ago
Write a class Student() such that it has an attribute 'score' (that is initialized with 10) and three methods: add_score(): adds
Feliz [49]

Answer:

I am writing the Python program. Let me know if you want the program in some other programming language. Here is the Python code:

class Student(object):

   def __init__(a,score=10):

       a.score=score

   def add_score(a,score):

       a.score += 10

       return (score)

   def decrease_score(a,score):

       a.score -=10

       return (score)

   def __str__(a):

       current_score="{}".format(a.score)

       return current_score

Explanation:

The program has a Student() class with attribute score.

It has the following methods:

__init__(): This method works as a constructor and enables to initialize score attribute of Student class. The value of score is initialized to 10. I have used a as the instance of Student class. However self keyword can also be used as an instance of the object to access the attributes and methods of Student class.

add_score() This method is used to add 10 to the score.

decrease_score() This method is used to decrease the score by 10.

__str__() This method is used to return the current score. format() is used here to return a string. current_score holds the value of the current score.

If you want the check the working of the program, then you can use the following statements to see the results on the output screen:

p = Student()

print(p)

p.add_score(p)

print(p)

This will create an object p of Student class and calls the above methods to display the values of the score according to the methods.

The program along with its output is attached.

7 0
2 years ago
Carrie works on a help desk and is assigned a ticket that was automatically generated by a server because of an error. The error
mixas84 [53]

The windows tool of weapon of choice that Carrie will use to troubleshoot the server is Powershell. All those GUI consoles built by Microsoft for Windows, by default, execute Powershell commands behind the scenes. Every possible thing that Carrie can do with the physical server can easily be accessible through Powershell's command line interface

Further Explanation

I would honestly say that there are a few available tools that Carrie can use, but the best tool is the inbuilt Windows Powershell. As Powershell continues to extend its purpose and usefulness, Microsoft, on the other hand, continues to use Powershell's capability to develop more cmdlets for products like Windows Servers.

Everything that can be done in a GUI environment can be done in Powershell. Carrie should be able to use Powershell to run things more efficiently from the command line without stepping a foot on the physical server. She will only need to access the server from her desk remotely, run a few commands, and that is it. Powershell command line is so powerful; it carries with it every troubleshooting pack that you can think about.

Learn More

brainly.com/question/10178399

brainly.com/question/10338479

#LearnWithBrainly

5 0
2 years ago
Read 2 more answers
If you were investigating login issues on a Windows computer, which portion of the Event Viewer logs would be a good place to st
USPshnik [31]

Answer:

If we are investigating login issues then we have to start with 'security logs' in 'windows logs' portion of Event viewer.

Explanation:

Much information about login issues is contained in log files which are related to security because it is mostly security issue. Some it is also better to start with 'system logs' portion of windows logs portion of Event viewer when there may be system problems instead of security issues. But in most cases there is security issues so 'security logs' is better option overall

6 0
2 years ago
Other questions:
  • "use the ______ element to create logical areas on a web page that are embedded within paragraphs or other block formatting elem
    15·1 answer
  • Column, bar, pie, line, and scatter are all types of_____
    9·1 answer
  • In a graphical user interface, which is a small symbol on the screen whose location and shape changes as a user moves a pointing
    10·1 answer
  • Leena needs to manually update the TOC and would prefer not to change the styles in the document.
    9·2 answers
  • Assume the existence of a Window class with a function getWidth that returns the width of the window. Define a derived class Win
    15·1 answer
  • What three requirements are defined by the protocols used in network communications to allow message transmission across a netwo
    11·1 answer
  • Make a class Employee with a name and salary. Make a class Manager inherit from Employee. Add an instance variable, named depart
    14·1 answer
  • 1. (1 point) Which flag is set when the result of an unsigned arithmetic operation is too large to fit into the destination? 2.
    13·1 answer
  • there is a structure called employee that holds information like employee code, name, date of joining. Write a program to create
    13·1 answer
  • daniel wants to buy a computer to use for playing games after work. he loves racing games and wants to make sure his device has
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!