1answer.
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
Darina [25.2K]
4 years ago
14

Write a method called makeStars. The method receives an int parameter that is guaranteed not to be negative. The method returns

a String whose length equals the parameter and contains no characters other than asterisks.
Computers and Technology
1 answer:
Alex Ar [27]4 years ago
3 0

Answer:

   public static String makeStars(int num){

       String stars ="";

       for(int i =0; i<num; i++){

           System.out.print("* ");

       }

       return stars;

   }

Explanation:

A complete java program calling the method makeStars and passing an argument of 5 is given below:

public class num1 {

   public static String makeStars(int num){

       String stars ="";

       for(int i =0; i<num; i++){

           System.out.print("* ");

       }

       return stars;

   }

   public static void main(String[] args) {

       System.out.println(makeStars(5));

   }

}

You might be interested in
How to change your phone number t mobile?
dexar [7]
U van change it by buying an new Sim card or buy trading it in
8 0
4 years ago
Your ASP.NET page contains a page-level variable of Customer type. You want to preserve the value of this variable across page p
alina1380 [7]

Answer:

Option c is the correct answer for the above question.

Explanation:

View states are a mechanism that is used in c# programming language, It is used on only one page on which the user or programmer is working currently. It does not hold the records when the control goes to the other page.

The above question also wants which is described above. Hence option c is the correct answer while the other is not because:-

  • Option a states about the query string which is not any technique to hold the record.
  • Option b states about cookies which are used to hold the record of all page.
  • Option d states about the session which is used to hold any record and can be accessed on any page.
8 0
4 years ago
Write a program that asks the user for a word. Next, open up the movie reviews.txt file and examine every review one at a time.
Hatshy [7]

Answer:

import numpy as np

word = input("Enter a word: ")

acc = []

with open("Downloads/record-collection.txt", "r") as file:

   lines = file.readlines()

   for line in lines:

       if word in line:

           line = line.strip()

           acc.append(int(line[0]))

   if np.mean(acc) >= 2:

       print(f"The word {word} is a positive word")

       print(f"{word} appeared {len(acc)} times")

       print(f"the review of the word {word} is {round(np.mean(acc), 2)}")

   else:

       print(f"the word {word} is a negative word with review\

{round(np.mean(acc), 2)}")

Explanation:

The python program gets the text from the review file, using the user input word to get the definition of reviews based on the word, whether positive or negative.

The program uses the 'with' keyword to open the file and created the acc variable to hold the reviews gotten. The mean of the acc is calculated with the numpy mean method and if the mean is equal to or greater than 2 it is a positive word, else negative.

5 0
3 years ago
Joe is examining the logs for his web server and discovers that a user sent input to a web application that contained the string
alexira [117]
SQL Injection Attack
6 0
2 years ago
Which key should you press to change the cell contents to your typed data
Free_Kalibri [48]

You can edit the contents of a cell directly in the cell. You can also edit the contents of a cell by typing in the formula bar.

When you edit the contents of a cell, Excel is operating in Edit mode. Some Excel features work differently or are unavailable in Edit mode.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following savings vehicles usually requires a high minimum balance
    14·1 answer
  • How many steps are there on Mail Merge Task Pane? List them.​
    9·1 answer
  • An example of live footage is when?
    10·2 answers
  • The transmission control protocol (TCP) layer helps computers to communicate in which of the following ways?
    9·1 answer
  • Which of the following is the definition of Internet Protocol Security ( IPSec)? A remote access client/server protocol. It is a
    13·2 answers
  • Which of the following is considered technology?
    12·1 answer
  • List the seven basic internal components found in a computer tower
    6·2 answers
  • In order to convert your project to a mobile platform, you need to do all of the following except:
    14·1 answer
  • Answered
    10·1 answer
  • One of the users in your company is asking if he can install an app on his company-provided mobile device. The installation of a
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!