// purpose: counterpoint to TellMe.java import java.util.*; public class MP3Sizer { // accepted value for gigabytes per song public static final double GIGABYTES_PER_SONG = 0.00471; // main(): program starting point public static void main( String[] args ) { // set up input scanner Scanner stdin = new Scanner( System.in ); // get number of songs System.out.print( "Enter number of songs: " ); int nbrSongs = stdin.nextInt(); // determine expected number of gigabytes to store songs double gigaBytes = GIGABYTES_PER_SONG * nbrSongs; // drop the decimal int storage = (int) ( gigaBytes ); // display result System.out.println( "Amount of storage necessary for " + nbrSongs + " songs is " + storage + " gBs" ); } }