Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- public class Voto {
- private double [] Voti;
- private String [] Materia;
- private int count;
- public Voto(){
- Voti=new double [10];
- Materia=new String[10];
- count=0;
- }
- public String Visual(){
- String s=" ";
- if(count==0){
- s="0 voti";
- } else {
- for(int i=0; i <count; i++){
- s += Voti[i] + " " + Materia[i] + ";" + " " ;
- }
- }
- return s;
- }
- public boolean Add (double v, String m){
- if(v<1 || v>10 || v==0){
- return false;
- }
- else{
- Voti[count]=v;
- Materia[count]=m;
- count++;
- return true;
- }
- }
- public int count(){
- return count;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement