• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Five Marks columns (Arrays)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I'm new to Java and this Forum so do bare with me if i make myself look stupid!!!

I have a task on my Programming course that requires me to use a integer array with an initialisation list of five marks.

I need the program to display two columns, one being peoples names and the other being the marks. I have figured how to get the names on a earlier program but now i'm struggling to get both marks and names together. I'm not asking you to give me the program but i need a little help to help me finish this small program.


Thanks for your time!!

P.s

This is the code i have so far!!!

import java.util.*;

public class fivemarks
{

public static void main(String[] args)
{
String[] name =
{"Chris Downs", "Jacob Cracker",
"Dee Mcgee", "Jack Dee", "Chloe Morrow"};

int[] mark = {78, 45, 48, 95, 22};

for (int i=0; i<1; i++)(String person:name)
{
System.out.println("\t\t\t\t\t\t" + person + mark[i]);


}

}

}

I'm sure the first bit is ok, the last bit i'm not to sure about!!

Thanks!!!
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please use the code tag ...

Have you compile it ? what it shows ? and how you think ?
 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Chris Downs wrote:



Why do you do this?
 
His brain is the size of a cherry pit! About the size of this ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic