Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- public class Voti {
- private double[] _Voti;
- private int _count;
- private String[] Materia;
- public Voti() {
- _Voti = new double[10];
- Materia = new String[10];
- _count = 0;
- }
- public boolean Inseriento(String c, double v) {
- if (v < 0 || v > 10) { //*LIMITI
- return false;
- } else {
- Materia[_count] = c;
- _Voti[_count] = v;
- _count++;
- return true;
- }
- }
- public String MostraVoti() {
- String s = "";
- if (_count == 0) {
- s = "non ci sono valutazioni";
- }
- else {
- for (int i = 0; i < _count; i++) {
- s = _Voti[i] + " " + Materia[i];
- }
- }
- return s;
- }
- public int count(){
- return _count ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement