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
Digiron [165]
3 years ago
12

Given the following method static void nPrint(String message, int n) { while (n > 0) { System.out.print(message); n--; } } Wh

at is the printout of the call nPrint('a', 4)?
Computers and Technology
1 answer:
Zolol [24]3 years ago
3 0

Answer: aaaa

Explanation:

Since the condition of n > 0 is satisfied, the number will decreement and the print out will look like the above answer.

You might be interested in
What are some examples of environmental technology
Zarrin [17]
Some examples of environmental technology is recycling.
3 0
3 years ago
9. Government and corporate officials concerned about security threats do not bring their own cell phones or laptops when travel
tatuchka [14]

Answer:

True

Explanation:

It is known as Don-Not-Carry rules are implemmented to avoid

-Unauthorized full disk copies (it have been made while the laptop owner was out of the hotel room on overseas travel)

-Laptops steals

- Monitoring by third parties of wireless using.

3 0
3 years ago
You create a database that stores data in tables that consist of rows and columns. each row has a primary key, and each column h
jeyben [28]
The answer is a relational database.

A data model in database management system consists of rules that define how the DB organizes data. Today, a relational database is widely used. It is a collection of data items organized as a set of formally described tables from which data can be accessed in many different ways.



3 0
3 years ago
Read 2 more answers
After adding an image to her flyer, Danica played around to see which layout would look the best. At one point, her text was on
Norma-Jean [14]

Answer:

Position Feature

Wrap text feature

Picture tools

Explanation:

3 0
3 years ago
Read 2 more answers
Write a program that prompts the user to enter in a postive number. Only accept positive numbers - if the user supplies a negati
marusya05 [52]

Answer:

The c++ program to check prime numbers is shown below.

#include <iostream>

using namespace std;

int main() {

   int num, prime=0;

   do

   {

       cout<<"Enter a positive number."<<endl;

       cin>>num;

       if(num<1)

       {

           cout<<"Invalid number. Enter a positive number"<<endl;

           cin>>num;

       }

   }while(num<1);

   

   if(num==1 || num==2 || num==3)

       cout<<num<<" is a prime number."<<endl;

   else if(num%2 == 0)

       cout<<num<<" is not a prime number."<<endl;

   else

   {

       for(int k=3; k<num/2; k++)

       {

           if(num%k == 0)

               prime++;

       }    

   if(prime>1)

       cout<<num<<" is not a prime number."<<endl;

   else

       cout<<num<<" is a prime number."<<endl;

   }

}

OUTPUT

Enter a positive number.

-7

Invalid number. Enter a positive number

0

Enter a positive number.

79

79 is a prime number.

Explanation:

The user input is validated for positivity. A do while loop along with an if statement is implemented for verification.

do

   {

       cout<<"Enter a positive number."<<endl;

       cin>>num;

       if(num<1)

       {

           cout<<"Invalid number. Enter a positive number"<<endl;

           cin>>num;

       }

   }while(num<1);

The test for prime number is done by using multiple if else statements.

If user inputs 1, 2, or 3, message is displayed.

Else If user inputs an even number, message is displayed for not prime. This is done by taking modulo of the number upon division by 2.

Else if user inputs neither an even number nor a number less than 3, the modulus of the number is taken with divisors beginning from 3 up to half of the input number.

For this, an integer variable prime is initialized to 0. A number can be completely divisible by itself or by its factors.

If the number is divisible by any of the divisors, value of variable prime is increased by 1. If value of prime is greater than 1, this means that the user input is divisible by more than one divisor. Hence, the given number is not a prime number.

5 0
3 years ago
Other questions:
  • Jannette has been experiencing slow performance on her computer. Today she received an error message saying that an update to he
    12·2 answers
  • Write a class named Averager containing: An instance variable named sum of type integer, initialized to 0. An instance variable
    6·1 answer
  • Nathan wants to create multiple worksheet containing common formatting styles for his team members. Which file extension helps h
    5·1 answer
  • // This pseudocode is intended to display // employee net pay values. All employees have a standard // $45 deduction from their
    12·1 answer
  • You are asked to optimize a cache design for the given references. Th ere are three direct-mapped cache designs possible, all wi
    7·1 answer
  • What is the relation between Information and Data?
    6·1 answer
  • What is a boolean in Java
    5·1 answer
  • NEED HELP FAST timed
    13·1 answer
  • Differentiate between patent and copyright.
    6·2 answers
  • The Internet is a worldwide communications network. Which device connects computer networks and computer facilities?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!