StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Arrays Program Issues - Essay Example

Cite this document
Summary
The essay "Arrays Program Issues" focuses on the critical analysis of the major issues in the program which initializes the array with the appropriate number of values determining the value in the array element when the index contains 2 and calculating the sum of the total miles…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER96.7% of users find it useful
Arrays Program Issues
Read Text Preview

Extract of sample "Arrays Program Issues"

It also uses loops to find out if 4 exists in the array and ejects the loop if it exists at a given index.

BostonMarathon.java using NetBeans IDE:
public class BostonMarathon {
/**
* @param args the command line arguments
*/ public static void main(String[] args) {
// TODO code application logic here
int startMileage=2;
int endMileage=26;
//8 weeks excluding the first and last week
int interval=(endMileage-startMileage)/8;
int weeklyMiles[]=new int[10];
for(int x=0;x<=9;x++){
weeklyMiles[x]=startMileage;
startMileage+=interval;
//Array element at index 2
System.out.println("Value at index 2:"+weeklyMiles[2]);
//Length of array
System.out.println("Lenght of array:"+weeklyMiles.length);
//Summation of total mileage
//Initialize total mileage to 0
int totalMileage=0;
for(int x=0;x<weeklyMiles.length;x++){
totalMileage+=weeklyMiles[x].

System.out.println("Total Distance Travelled:"+totalMileage);
float average;// declare variable to hold average
System.out.println("Average Mileage:"+(float)totalMileage/10);
//Search if 4 exists in the array
for(int y=0;y<weeklyMiles.length;y++){
if(weeklyMiles[y]==4){
System.out.println("4 is present at index:"+y);
break.

Output:
Value at index 2:8
Length of array:10
Total Distance Travelled:155
Average Mileage:15.5.

Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Arrays program Essay Example | Topics and Well Written Essays - 250 words”, n.d.)
Arrays program Essay Example | Topics and Well Written Essays - 250 words. Retrieved from https://studentshare.org/information-technology/1669607-arrays-program
(Arrays Program Essay Example | Topics and Well Written Essays - 250 Words)
Arrays Program Essay Example | Topics and Well Written Essays - 250 Words. https://studentshare.org/information-technology/1669607-arrays-program.
“Arrays Program Essay Example | Topics and Well Written Essays - 250 Words”, n.d. https://studentshare.org/information-technology/1669607-arrays-program.
  • Cited: 0 times

CHECK THESE SAMPLES OF Arrays Program Issues

Social Security Program Issues

The so-called ‘Poor Laws' promulgated in England are the first record of legislation which resembles the social security program as we know it today (Sutherland).... They also set forth a taxation mechanism to provide financial support for a welfare program and also defined the eligibility criteria for the beneficiaries of this program....
10 Pages (2500 words) Research Paper

Poverty and Food Insecurity Issue and the SNAP Program

In response to food insecurity, the government has created the SNAP program.... The government should create a program which will support the settlement of American sin rural areas in order to solve the issue of housing and at the same time increase per capita food production Poverty and food insecurity are related in a very close manner.... Subsidized food, as provided by the SNAP program cannot be the solution in the long run due to the fact that it only creates more depend people who end up being a burden to the economy....
16 Pages (4000 words) Essay

Ending Government's Offending Program

In this particular paper we ask how the "ending offending program" helps curtail the Australian problem of crimes associated with substance abuse.... t is the goal of this paper that we ascertain how specifically the "Ending Offending program" helps abate criminal offenses such as the likelihood of re-offending of those who underwent the program versus those who did not.... ime series analysis in which we compare the result of for those offenders before and after the program was instituted will be done....
14 Pages (3500 words) Essay

Communication Plan Barriers: Prisoner Re-Entry Program

The major issues include prerelease planning, community referrals, challenges between the offender and reentry-prisoners, quick access to benefit programs, continuity of.... Subsequently, many the prisoners often go Communication Plan: Prisoners' reentry Program The administration issues and why it is concerned to the public?... There are numerous societal and administration issues closely associated with prisoners' reentry program.... The major issues include prerelease planning, community referrals, challenges between the offender and reentry-prisoners, quick access to benefit programs, continuity of care, employment, housing, problems related to medications etc (Alarid, Cromwell & Del Carmen, 2007, p....
2 Pages (500 words) Essay

CREATING A PROGRAM RATIONALE

The regular health camps would assess the weight issues along with offering right diet plan.... Just for Kids is another leading obesity prevention program raising awareness on health issues along with promoting and supporting a number of physical and mental activities.... This is because of the cultural differences and little awareness and thus requires data and information to analyze the obesity issues among children of age group 12-17.... The rationale of the proposed program along with its relevance will be highlighted in a logical and illustrative manner using wide arrays of examples. ...
2 Pages (500 words) Essay

Police Intervention Programs

intervention programs, the criminal is not regarded as a criminal but as one who needs the intervention of the police and other professionals to help them in dealing with their issues.... ccording to Corey et al (2005), intervention programs can be regarded as a way to better deal with crime issues in the streets.... The state of the situation with police intervention programs indicate that not a lot of them Intervention program can be dangerous because in most cases it requires the police officer to tame the law enforcement side f his career and try to be friend with the criminal....
4 Pages (1000 words) Research Paper

Food Safety Program

This new program aims at creating awareness in all states on issues related to food safety.... However, most consumers lack information on issues that come up with issues of food poisoning.... The paper "Food Safety program" discusses that generally, the main aim of the agriculture department is to develop and execute a number of policies on behalf of the federal government in areas of agriculture, subsistence and commercial farming and forestry....
4 Pages (1000 words) Essay

Aircraft Structural Design: Ageing Aircraft Program

"Aircraft Structural Design: Ageing Aircraft program" paper states that considering the enormous cost of acquiring a new aircraft, alongside the existing limited reliable manufacturer around the world, the aging aircraft need be maintained in service for a period longer than expected....
15 Pages (3750 words) Coursework
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us