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
Natalija [7]
4 years ago
5

Write a Java program that prompts the user for an int n. You can assume that 1 ≤ n ≤ 9. Your program should use embedded for loo

ps that produce the following output: 1 2 1 3 2 1 4 3 2 1 5 4 3 2 1 . . . n . . . 5 4 3 2 1 Your prompt to the user should be: Please enter a number 1...9 : Please note that your class should be named PatternTwo.

Computers and Technology
1 answer:
zlopas [31]4 years ago
8 0

Answer:

Here is the JAVA program:

import java.util.Scanner;  // to take input from user

public class PatternTwo{   //class name

public static void main(String args[]){  //start of main function

Scanner scan = new Scanner(System.in);   // creates Scanner class object

System.out.print("Please enter a number: ");  //prompts user to enter an int n for the number of rows

int n = scan.nextInt();   //reads and scans the value of n from user

int i, j;   //declares two variables to iterate through i  rows and j columns

for (i=1; i<=n; i++){    //outer loop for rows  

for (j=2*(n-i); j>=1; j--){   //inner loop for space between numbers in pattern  

System.out.print(" ");  }   //displays an empty space in the pattern

for (j = i; j >= 1; j--)  { //inner loop for columns  

System.out.print(j+" "); }   //prints the value of j (prints numbers in reverse)

System.out.println();   }   }   }  //prints a new line after printing each row

Explanation:

The program is explained with an example in the attached document.

You might be interested in
Everytime my daughter tries to ask for an app, or a money thing inside an app.. The request won't go through. Anybody know how t
Ilya [14]

Answer:

Signs your phone may have been hacked

1. Noticeable decrease in battery life

While a phone’s battery life inevitably decreases over time, a smartphone that has been compromised by malware may start to display a significantly decreased lifespan. This is because the malware – or spy app – may be using up phone resources to scan the device and transmit the information back to a criminal server.

(That said, simple everyday use can equally deplete a phone’s lifespan. Check if that’s the case by running through these steps for improving your Android or iPhone battery life.)

2. Sluggish performance

Do you find your phone frequently freezing, or certain applications crashing? This could be down to malware that is overloading the phone’s resources or clashing with other applications.

You may also experience continued running of applications despite efforts to close them, or even have the phone itself crash and/or restart repeatedly.  

(As with reduced battery life, many factors could contribute to a slower phone – essentially, its everyday use, so first try deep cleaning your Android or iPhone.)

3. High data usage

Another sign of a compromised phone is an unusually high data bill at the end of the month, which can come from malware or spy apps running in the background, sending information back to its server.

4. Outgoing calls or texts you didn’t send

If you’re seeing lists of calls or texts to numbers you don’t know, be wary – these could be premium-rate numbers that malware is forcing your phone to contact; the proceeds of which land in the cyber-criminal’s wallet. In this case, check your phone bill for any costs you don’t recognize.

5. Mystery pop-ups

While not all pop-ups mean your phone has been hacked, constant pop-up alerts could indicate that your phone has been infected with adware, a form of malware that forces devices to view certain pages that drive revenue through clicks. Even if a pop-up isn’t the result of a compromised phone, many may be phishing links that attempt to get users to type in sensitive info – or download more malware.  

6. Unusual activity on any accounts linked to the device

If a hacker has access to your phone, they also have access to its accounts – from social media to email to various lifestyle or productivity apps. This could reveal itself in activity on your accounts, such as resetting a password, sending emails, marking unread emails that you don’t remember reading, or signing up for new accounts whose verification emails land in your inbox.

Explanation:

7 0
3 years ago
A gui allows you to interact with objects on the screen such as icons and buttons true or false
gizmo_the_mogwai [7]
The answer to your question is true
5 0
3 years ago
When streaming video, data is temporarily stored in a
dangina [55]

Answer:

hey,ik this isnt the answer,but we talked yesterday. my acct got deleted,so i had to make a new one.

Explanation:

6 0
3 years ago
Read 2 more answers
What else can Xbox do to help reduce negative online behavior? (250 minimum)
geniusboy [140]
Have a report button
6 0
3 years ago
Play-e-ball, a company that creates games for gaming consoles, gathers data from the information systems of its partners, suppli
ad-work [718]

Answer:

Option B

Explanation:

It is the perfect example of BI(Business Intelligence).

7 0
3 years ago
Other questions:
  • What is the legal right granted to all authors and artists that gives them sole ownership and use of their words, software, pict
    9·2 answers
  • The Michael Porter Diamond of National Advantage is a framework that explains why countries foster successful multinational corp
    11·1 answer
  • Which types of files are saved with the .mp3 and .zip extensions?
    12·2 answers
  • Write function that ask for input from a user. Use this input as input for the countdown function that we wrote using the while
    6·1 answer
  • WHO SAYS BUP ALL THE TIME ​
    8·1 answer
  • List out various computer generation long with their basic characteristic ​
    13·1 answer
  • What happens when you run a program in Python? ​
    12·2 answers
  • What feature is required to track customer search terms on a website?
    9·1 answer
  • Which statement best describes network security?
    7·1 answer
  • The SQL SELECT built-in function COUNT ____.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!