CONNEXION
  • RetourJeux
    • Sorties
    • Hit Parade
    • Les + populaires
    • Les + attendus
    • Soluces
    • Tous les Jeux
    • Gaming
  • RetourActu Gaming
    • News
    • Astuces
    • Tests
    • Previews
    • Toute l'actu gaming
  • RetourBons plans
    • Bons plans
    • Bons plans Smartphone
    • Bons plans Hardware
    • Bons plans Image et Son
    • Bons plans Amazon
    • Bons plans Cdiscount
    • Bons plans Decathlon
    • Bons plans Fnac
    • Tous les Bons plans
  • RetourJVTech
    • Actus High-Tech
    • Intelligence Artificielle
    • Smartphones
    • Mobilité urbaine
    • Hardware
    • Image et son
    • Tutoriels
    • Tests produits High-Tech
    • Guides d'achat High-Tech
    • JVTech
  • RetourCulture
    • Actus Culture
    • Culture
  • RetourVidéos
    • A la une
    • Gaming Live
    • Vidéos Tests
    • Vidéos Previews
    • Gameplay
    • Trailers
    • Chroniques
    • Replay Web TV
    • Toutes les vidéos
  • RetourForums
    • Hardware PC
    • PS5
    • Switch 2
    • Xbox Series
    • Switch
    • Pokemon pocket
    • FC 25 Ultimate Team
    • League of Legends
    • Tous les Forums
  • PC
  • PS5
  • Xbox Series
  • Switch 2
  • PS4
  • One
  • Switch
  • iOS
  • Android
  • MMO
  • RPG
  • FPS
En ce moment Genshin Impact Valhalla Breath of the wild Animal Crossing GTA 5 Red dead 2
Liste des sujets

[Java] aide pour un Exercice

FlRE
FlRE
Niveau 5
17 novembre 2009 à 19:11:17

:salut: , j'ai un exercice a faire pour la semaine prochaine et je suis completement perdu ...

Il faut ecrire un java code programme pour que cela fonctionne comme le starter programme d'en bas .

:d) Feuille donnee par le prof .

--------------------------------------------------
----------
import java.util.Scanner;
import java.text.NumberFormat;

public class PaintersHelper {
static float DOOR_SIZE = 15.0f;
static float SMALL_WINDOW_SIZE =2.0f;
static float LARGE_WINDOW_SIZE = 5.0f;
static float SQ_FT_PER_GALLON = 375.0f;

public static void main(String[] args) {
// declare all variables to be used (I provide a couple to get you started.)
float gallons = 0.0f;
NumberFormat nf = NumberFormat.getNumberInstance();

// give welcome and instructions to user

// prompt user for the room's width

// prompt user for the room's length

// prompt user for the room's height

// prompt user for the number of doors

// prompt user for the number of small windows

// prompt user for the number of large windows

// gross square feet = height * 2 * (length + width)

// subtractions is the sum of:
// number of doors * door size
// number of lgWindows * lgWindow size
// number of smWindows * smWindow size

// net square feet = gross square feet - subtractions

// gallons = netSqFt / SQ_FT_PER_GALLON rounded to the nearest tenth of a gallon

// display the answer.

System.out.println("\nYou will need about " + nf.format(gallons) + " gallons of paint.");
Scanner sc = new Scanner(System.in);
System.out.println("Hit any key (except space or Enter) + 'Enter' to quit.");
String throwAway = sc.next();
} // end of method main

} // end of class PaintersHelper

:merci: Pour votre aide .

godrik
godrik
Niveau 30
17 novembre 2009 à 19:13:04

j'ai rien compris a ton texte.
Mais le programme m'a l'air assez direct.

_skip
_skip
Niveau 10
18 novembre 2009 à 09:09:18

En gros ça te demande juste de rajouter le code pour lire et tester les dimensions. Puis ensuite de faire un petit calcul.
Nous on peut pas faire tes devoirs à ta place, dis plutot ou tu bloques et on essaiera de t'aider.

Sous forums
  • Aide à l'achat Mac
  • Macintosh
  • Création de Jeux
  • Programmation
  • Création de sites web
  • Linux
  • Internet
  • Steam Deck
  • Hardware
La vidéo du moment