Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8552929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:32:10+00:00 2026-06-11T14:32:10+00:00

This are my requirements: Read in an integer from the user (n) Declare an

  • 0

This are my requirements:

  1. Read in an integer from the user (n)
  2. Declare an array of floating point numbers of size n
  3. Fill in this array with random floating point numbers between 0 and 100.
  4. Calculate and display the percentage of values in the array that are at least 70

I dont know how to do the last part.

import java.util.Random;
import java.util.Scanner;
/**
 *
 *
 */
public class Mo {

    /**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    // TODO code application logic here
    System.out.print("please enter a number: ");
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();

    float[] values;
    values = new float[n];

    int[] counters;
    counters = new int[n];

    Random r = new Random();

    for(int i=0; i < values.length; i++)
    {
        values[i] = r.nextInt(100);
        System.out.print(values[i] + " " );

    }
    System.out.println();
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:32:10+00:00Added an answer on June 11, 2026 at 2:32 pm

    Count numbers of values that are <70 then divide this count by total count
    if (values[i] >= 70 )
    count++;

    outside the for

    count/values.length*100

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read this post and I can't meet my requirements. My Folder structure
I need help remembering what book I read this from, It might have been
I have the requirements to build a service that will Read a notification from
From all the articles I've read so far about Mochiweb, I've heard this over
I just read this requirement on a job listing: Aware of the pitfalls of
I have some business requirements which sound something like this: Find the data in
I am writing a Product requirements specification. In this document I must describe the
What are the requirements for the upcoming .NET 4 release? Searched around for this
The ObjectChoiceField field meets all my requirements but it is not pretty. This is
How can I have an accessible read only checkbox in Silverlight? The accessibility requirements

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.