Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dato il metodo calcolaCosto:
- calcolaCosto(char tipo, int numeroMesi, int numeroTarghe){
- int costo=0;
- switch (tipo) {
- case “A”: costo = 120; break;
- case “B”: costo = 180; break;
- case “C”: costo = 100; break;
- default : throw new IllegalParameter();
- }
- switch (numeroMesi) {
- case “1”: break;
- case “3”: costo = costo * 3 * 0,9; break;
- case “12”: costo = costo * 12 * 0,82; break;
- default : throw new IllegalParameter();
- }
- switch (numeroTarghe) {
- case “1”: break;
- case “2”: costo = costo * 1,15; break;
- case “3”: costo = costo * 1,25; break;
- default : throw new IllegalParameter();
- }
- }
- Calcolare la percentuale (anche data come frazione) della copertura dei comandi e dei cammini del caso di test (B, 2,3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement