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
Sever21 [200]
3 years ago
14

Alguém me ajuda nesse algoritmo?

Computers and Technology
1 answer:
satela [25.4K]3 years ago
8 0

Answer:

Explanation:

First we must import the package import java.util.*;

we create our scanner and we declare our variables and array

We create a for cycle, and inside the for the If sentence to evaluate every number then we print our negative and positive numbers.

numbers[10]

nega

posi

Scanner num = new Scanner(System.in);

       int numbers[] = new int[10];

       int nega  = 0;

       int posi = 0;

       

       for(int i=0; i<=9; i++)

       {

        System.out.print("Enter the number "+ (i+1) +":");

        numbers[i] = num.nextInt();

         

        if(numbers[i]<0){

            nega++;

        }

        else

        {

            posi++;

        }

        System.out.println("Negative numbers are: " + nega);

        System.out.println("Positive numbers are: " + posi);

       }

You might be interested in
Do you remember your first 3D movie experience? What was the movie, what was the experience like, and why was it memorable? (If
maria [59]

Answer:

I went to my first 3d movie when I was 12. I remember thinking that it wouldnt look real or realistic but when I tried it out it was pleasantly surprised on how real it looked.

Explanation:

3 0
3 years ago
Does anyone have 2.19.4 Guess a number 2.0 code for codehs?
lubasha [3.4K]

Answer:

I'm trying to create a program that will ask the user for an exam score in the range 0 to 100. ... I want to take the python course but I have not class code, anyone can help?

Explanation:

3 0
3 years ago
name instances in the past where social media has kept you informed about the latest news around the country​
Luba_88 [7]
BLM movement and protests,
The election, school shootings, and the pandemic
3 0
3 years ago
Read 2 more answers
I keep getting this error: postfix.cpp: In function ‘double RPN_evaluation(std::string)’: postfix.cpp:42:26: error: cannot conve
Svetradugi [14.3K]

Answer:

expr.at(g) returns a string, not a char. They are not the same thing and that is what the compiler is complaining about.

3 0
4 years ago
1. Write a bash script to create 3 files of different size greater than 1700 kb and less than 1800 kb . The 2. Content of the fi
Mazyrski [523]

Answer:

See explaination

Explanation:

Bash Script:

#!/bin/bash

echo "Creating files a.txt, b.txt, c.txt..."

#1

# Create a random number between 1700 to 1800. This is the Kb we are looking for

# And then multiply by 1000 (1Kb = 1000 bytes)

r=$(( ($RANDOM % 100 + 1700) * 1000 ))

# head -c specifies the number of chars to read from the input,

# which is /dev/urandom stream in this case.

# Ideally we should have just used r*1000 to specify number of bytes,

# but since we are pipelining it to base64 to get text chars,

# this conversion will happen in the ratio of 4/3.

head -c $r /dev/urandom | base64 > a.txt

# Hence, we trunctate the file to the exact (random number we generated * 1000) bytes

truncate -s $r a.txt

r=$(( ($RANDOM % 100 + 1700) * 1000 ));

head -c $r /dev/urandom | base64 > b.txt

truncate -s $r b.txt

r=$(( ($RANDOM % 100 + 1700) * 1000 ));

head -c $r /dev/urandom | base64 > c.txt

truncate -s $r c.txt

#3 Use tar command to create all_three.tar from a.txt, b.txt, c.txt

tar -cf all_three.tar a.txt b.txt c.txt

echo $(stat -c "%n: %s" all_three.tar)

#4 Gzip a.txt into a.gz (without deleting the original file) and so on

gzip -c a.txt > a.gz

gzip -c b.txt > b.gz

gzip -c c.txt > c.gz

echo $(stat -c "%n: %s " a.gz b.gz c.gz)

#5 Gzip a.txt, b.txt, c.txt into all_three.gz

gzip -c a.txt b.txt c.txt > all_three.gz

echo $(stat -c "%n: %s" all_three.gz)

#6 Gzip the all_three.tar we created in #3

gzip -c all_three.tar > all_three.tar.gz

echo $(stat -c "%n: %s" all_three.tar.gz)

# Check all files we created with ls command sorted by time in ascending order

ls -ltr a.txt b.txt c.txt all_three.tar a.gz b.gz c.gz all_three.gz all_three.tar.gz

4 0
3 years ago
Other questions:
  • How to reply to text from unknown number?
    11·1 answer
  • Anna’s computer will not power on. What aspect of the computer should Anna check (hardware or software)? How can Anna work to re
    5·1 answer
  • In java, a class that is defined without an explicit extends clause ____.
    15·2 answers
  • When a project manager can look at the progress towards the goals set, this is considered...?
    11·2 answers
  • ACME Corp. is developing a software program that can run on mobile devices so that customers can interact with the firm, view pr
    13·1 answer
  • 3. Which of the following is called address operator?<br> a)*<br> b) &amp;<br> c).<br> d) %
    12·1 answer
  • Write the Stats method record that takes a test score and records that score in the database. If the score already exists in the
    15·1 answer
  • Which of the following is referred to as "keeping up with the Joneses"?
    13·1 answer
  • Why people shouldnt get married​
    6·1 answer
  • What is a thread? what resources does it share with other threads in the same process?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!