Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PleAse show codes in java Thanks 1. Write a program which asks the user to enter an integer value, n. Declare an array of int's

PleAse show codes in java
Thanks image text in transcribed
1. Write a program which asks the user to enter an integer value, n. Declare an array of int's of size n. Find every prime number starting with 2, and write each into the next available cell in your array. Repeat this n times until your array is full. Use a while loop to do this. Then, using a for loop, compute the average of your prime numbers. Your n should be a positive integer less than or equal to 1000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn Mysql The Easy Way A Beginner Friendly Guide

Authors: Kiet Huynh

1st Edition

B0CNY7143T, 979-8869761545

More Books

Students also viewed these Databases questions

Question

Show that any random variable is uncorrelated with a constant.

Answered: 1 week ago