Gregory Desrosiers Montreal

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Sunday, 18 November 2012

Java Program : Fat Gram Calculator

Posted on 18:06 by Unknown
Here's another program I want to share with you guys, which is simply a program that multiplies the number of grams of fat in food by nine, which gives off how many calories you earn upon eating a serving of that snack or provision. You need to enter the number of calories in the actual serving in that calculator and the number of grams of fat, and what will do is it will calculate the percentage and determine whether the food has a high amount of fat, at least 30%, or not.

This time, there are no notes taken on how this works.

import javax.swing.JOptionPane;
import java.text.DecimalFormat;

public class FatGramCalculator
{
    public static void main(String[] args)
    {
        String inputString;
        float totalCalories,
            fatGrams,
            caloriesFromFat,
            ratio,
            percent;
       
        DecimalFormat formatter = new DecimalFormat("##");
       
        inputString =
                JOptionPane.showInputDialog("How many calories are in the food item you want to study?");
        totalCalories = Float.parseFloat(inputString);
       
        inputString =
                JOptionPane.showInputDialog("How much fat is in the food item, in grams?");
        fatGrams = Float.parseFloat(inputString);
       
        caloriesFromFat = fatGrams * 9;
       
        ratio = caloriesFromFat / totalCalories;
       
        percent = ratio * 100;
       
        if (percent > 100)
            JOptionPane.showMessageDialog(null, "Invalid entry.");
       
        if (percent <= 100)
            JOptionPane.showMessageDialog(null, "Number of calories in food item: " + totalCalories +
                                        "\nNumber of grams of fat in food item: " + fatGrams +
                                        "\n\nPercent of calories of fat to total calories: " +
                                        (formatter.format(percent)) + "%");
       
        if (percent < 30)
            JOptionPane.showMessageDialog(null, "The food item is low in fat.");
       
        System.exit(0);
           
    }
}
Read More
Posted in | No comments

JAVA Program: Military Time to Real Time

Posted on 17:57 by Unknown
Hello, people. How you doing? I'm really busy with my college homework, but I am working so hard to pass my courses and continue in my studies to pursue my future career as a producer and director of computer games.

Want to get into the words of Namco's Time Crisis II? Here's another JAVA Program for you guys; this one was done last year in my Java Programming Level 1 class with Linda McGirr.

Luckily, this program, with the source file name MilitaryTimeDifferenceToRealTimeImproved.java, includes all the necessary comments to explain the process.

One thing before you read: A single line of comments is marked by two forward slashes, while a block of comments is marked as follows:

/*
*
*
*/

The program was written on Eclipse Indigo, a free IDE that provides the necessary tools and shortcuts to programming JAVA applications.

Enjoy reading the program! (This file is copied to this Blogger post as is.)


/*
*
*    Military Time Difference in Real Time Assignment
*
*    This program is designed to yield out the difference
*    of two independent military times, what's current
*    and what's due for, let's say, an estimation of
*    how long left before the Afghan Forces attack
*    a United States base in Kabul, in real time
*    (hours : minutes). When we enter the times of what's
*    current and what's due, this program will produce
*    the result in real-time format. This is helpful for
*    military personnel to interpret the difference in
*    real-time format to their relatives who can't
*    really convert from military time to real time
*    by themselves.
*
*    File Name: MilitaryTimeDifferenceToRealTimeImproved.java
*    Developed by Gregory Desrosiers, Student of Champlain College
*    St-Lambert, Quebec, Canada
*
*    Teacher : Linda McGirr
*
*    Assignment Record Dates
*
*    Psuedocode Start Date: Wednesday, September 21, 2011
*    Psuedocode End Date: Wednesday, September 21, 2011, 12:57 PM
*
*    Coding Start Date: Wednesday, September 21, 2011, 1:13 PM
*    Coding End Date: Saturday, September 24, 2011, 2:06 PM
*
*    The coding has been modified as of September 26, 2011 at 1:21 PM.
*
*    Comments are provided in each step of the process of this program.
*    The psuedocode is provided in the 'Assignment 2 - Psuedocode.docx'
*    file. You will need Microsoft Office Word to open it.
*
*    The psuedocode has been modified as of Wednesday, September 21,
*    2011, at 4:47 PM. This psuedocode, however, only covers the
*    logic of the original program where there were problems found
*    with the output, so there are logical errors.
*
*    No psuedocode is provided in this version because as of September 24,
*    I had way too much homework to make a psuedocode that matches the
*    style of this one, so the psuedocode is omitted.
*
*    To make the programming easier, this program has two 'if'
*    statements, a code that has not yet been covered by
*    Ms. McGirr in the Starting Out With Java textbook.
*
*    There are no if statements for correcting the entry of negative
*    numbers and decimals.
*
*    Part of the program was aided by Bruno Gosselin.
*/


// The following statement is needed to enable dialog boxes.

import javax.swing.JOptionPane;
/*
     The following four lines are important for the program to
     work where the two sets of braces connect the statements to
     the method and the method to the class file, similarly, the
     binary file in the Java language.
*/

public class MilitaryTimeDifferenceToRealTimeImproved
{
    public static void main(String[] args)
    {
       
        // Here are the variables declared with comments explaining
        // their use and their meaning.

       
        String inputString;
                /*
                 * This holds the input for the current military time
                 * and the due military time from two dialog boxes.
                 * They will then be used in the parse methods to
                 * convert the characters inputted into integers.
                 */

       
        int currentMilitaryTime,
                /*
                 * This holds the natural number of the current
                 * military time. Natural, because time numbers
                 * cannot be negatives.
                 */

       
            dueMilitaryTime,
                /*
                 * This holds the natural number of the due
                 * military time.
                 */

           
            dueHours,
                /*
                 * This holds the first digit in the
                 * dueMilitaryTime variable.
                 */

           
            dueMinutes,
                /*
                 * This holds the last two digits in the
                 * dueMilitaryTime variable.
                 */

           
            currentHours,
                /*
                 * This holds the first digit in the
                 * currentMilitaryTime variable.
                 */

           
            currentMinutes,
                /*
                 * This holds the last two digits in the
                 * currentMilitaryTime variable.
                 */

           
            outputHours,
                /*
                 * This holds the result for the hours that will
                 * be displayed later on in the program.
                 */

           
            outputMinutes;
                /*
                 * This holds the result for the minutes that
                 * will be displayed later on in the program.
                 */

       
        /*
         * The two statements shown below are for the input of the current
         * military time and converting the input into a number because
         * the entry will only be a string of characters.
         *
         * This is where we see the first dialog box.
         *
         * For both dialog boxes, the programming style is not met,
         * but this is for the purpose of printing the code on paper only.
         */

       
        inputString =
            JOptionPane.showInputDialog("What is the current military time?");
        currentMilitaryTime = Integer.parseInt(inputString);
       
        /*
         * The next two statements follow the same process as the current
         * military time, except this time, it's for the due military time.
         */

       
        inputString =
            JOptionPane.showInputDialog("What is the due military time?");
        dueMilitaryTime = Integer.parseInt(inputString);
       
       
        /*
         * Now, we seperate the hours and minutes from each inputted
         * values. To do this, we use both the division and modulus
         * operators where an hour in military time is set at every
         * interval of 100. Technically, there are 60 minutes in
         * one hour, but the hours fit into 100, so we use the division
         * of 100 for hours and the modulus to get the remainder
         * of the hour division, which is then assigned to the
         * variable representing minutes.
         */

        currentHours = currentMilitaryTime / 100;
       
        currentMinutes = currentMilitaryTime % 100;
       
        dueHours = dueMilitaryTime / 100;
       
        dueMinutes = dueMilitaryTime % 100;
       
        /*
         * This is where we find the difference in time where the
         * two following statements are effective when the
         * due military time is later on in the same day
         * than the time it is right now.
         */

       
        outputHours = dueHours - currentHours;
       
        outputMinutes = dueMinutes - currentMinutes;
       
        /*
         * Now, we do include the most crucial process, but there
         * are a couple of catches.
         *
         * One is what if the variable 'dueMinutes' is smaller
         * than 'currentMinutes' in inputs where one example
         * would be that the current time is 0945 hours and
         * the due is 1030 hours? The result will be a negative
         * number and plus one on the 'outputHours' variable,
         * which doesn't make sense.
         *
         * To solve the first catch, we use a conditional
         * statement where if the result of minutes is negative,
         * it will subtract one from 'outputHours' and add
         * 60, which gives the complementary value of
         * 'outputMinutes' and stores the value in that
         * variable. Braces are used because we are executing
         * two statements at the same time.
         */

       
        if (outputMinutes < 0)
        {
            outputHours -= 1;
            outputMinutes += 60;
        }
       
        /*
         * Another catch is, what if the current time is before
         * midnight and the due is after midnight? We do get
         * the minutes right, but not the hours. It will be
         * negative. To compensate it, we add 24 to
         * 'outputHours' where it gives us the complementary
         * value and stores the value in it. There are no
         * braces because we're only executing one
         * statement.
         */

       
        if (outputHours < 0)
            outputHours += 24;
       
        // This is where we display the result.
       
        JOptionPane.showMessageDialog(null, "Current time in military format: "
                                    + currentMilitaryTime + " hours." +
                                    "\nDue time in military format: " +
                                    dueMilitaryTime + " hours." +
                                    "\n\nThe difference between those times is "
                                    + outputHours + " hours and " +
                                    outputMinutes + " minutes.");
       
        /* The next statement is for the last dialog box.
         * This is the last output we will see before the
         * program terminates (closes).
         */

       
        JOptionPane.showMessageDialog(null, "Program Complete.");
       
        /* This is the last statement in the program.
         * It will stop dialog boxes from appearing and
         * closes the program.
         */

       
        System.exit(0);
    }
}
Read More
Posted in | No comments

Tuesday, 23 October 2012

List of Played N64 Games

Posted on 16:25 by Unknown
Hello, guys.

Let me introduce to you a list of N64 games I have played when I was young; the N64 was one of the two consoles I had, besides the PlayStation; we actually brought it in 1998. I can tell by what I remember seeing on the back of the box and what games were advertised.

For now, I do not have an image of what the back of the bundle box would look like, but you tell me whether or not you want to see it and I'll find it for you.

Here are the games that I have played on the N64 or watched at least once:

Super Mario 64
Mario Kart 64
Star Fox 64
The Legend of Zelda: Ocarina of Time
The Legend of Zelda: Majora's Mask
Star Wars: Shadows of the Empire
Mario Golf
Mario Tennis
Tony Hawk's Pro Skater
Tony Hawk's Pro Skater 2
Goldeneye
Perfect Dark
Mickey's Speedway USA
Kirby 64: The Crystal Shards
Super Smash Bros.
Star Wars: Rogue Squadron
Star Wars: Battle of Naboo
Superman 64 (worst game of all time)
F1 Pole Position 64
F1 World Grand Prix
Tonic Trouble
Buck Bumble
Penny Racers
Aerogauge
Virtual Pool 64
Fighting Force 64
Chameleon Twist
Donkey Kong 64
NFL Blitz
NFL Blitz 2000
International SuperStar Soccer 64
Wayne Gretzky's 3D Hockey
Harvest Moon 64
Tetrisphere
The New Tetris
Pokemon Snap
Pokemon Stadium
Pokemon Stadium 2
Pokemon Puzzle League
Ridge Racer 64
GT 64
Quest 64
Waialae Country Club: True Golf Classics
Automobili Lamborghini
Top Gear Rally
Top Gear Rally 2
Top Gear Hyper-Bike
Top Gear Overdrive
Wheel of Fortune
007: The World Is Not Enough
Quake II
A Bug's Life
Toy Story 2
Aerofighters Assault
Beetle Adventure Racing
Castlevania 64
Banjo-Kazzoie
Banjo-Tooie
Diddy Kong Racing
Donkey Kong 64
Bass Hunter 2000
Bomberman 64
Bust-A-Move '99
Command and Conquer
Cruis'n USA
Cruis'n World
Cruis'n Exotica
Excitebike 64
Extreme G
Extreme G-2
F-Zero X
GEX 3: Enter the Gecko
Hot Wheels: Turbo Racing
Micro Machines 64 Turbo
San Francisco Rush
San Francisco Rush 2
San Francisco Rush 2049
Hydro Thunder
Indy Racing 2000
World Driver Championship
LEGO Racers
Mario Party
Mario Party 2
Mario Party 3
Mega Man 64
Mischief Makers
Rugrats Scavenger Hunt
South Park
South Park Chef Luv's Shack
Monster Truck Madness 64
Pilotwings 64
Paper Mario
MRC Racing Championship
Mortal Kombat 4
Mystical Ninja Starring Goemon
Nagano Winter Olympics '98
NASCAR '99 (by EA)
EA Supercross 2000
Offroad Challenge
Paperboy 64
Rally Challenge 2000
Rampage: World Tour
Rayman 2: The Great Escape
Ready 2 Rumble
Roadsters
Wetrix
Snowboard Kids
Snowboard Kids 2
Re-Volt
Road Rash 64
Star Wars: Episode I Racer
Glover
Twisted Edge: Extreme Snowboarding
Vigilate 8
Vigilante 8: 2nd Offense
Wipeout 64
Yoshi's Story

That does it; I have played 117 games in all! Tell me how many you guys played... :)

See you!


Please make a donation to me for an advertising campaign for my e-book, The Asperger Computer! All donations will be kept track and shall be used for a Facebook advertising campaign. Optimistically, I should have a donated budget of $100 before making way for a much larger Facebook ad campaign for my e-book. Donations exceeding the budget will either add up to the budget for the mass ad campaign, or to boost a post, primarily for the status on Facebook sharing all the links for people to buy my e-book!

If you donate more than $4.00 CAD, you will get my e-book for free. You aren't necessarily paying for my e-book by doing so because all of that $4.00 and over donated will be spent for advertising, to fulfill the purpose of "fundraising" or "not-for-profit" campaign.

Come support my efforts!
 Click here to follow me on Facebook: https://www.facebook.com/TheAspergerComputerGregDes?ref=hl
Read More
Posted in | No comments

Tuesday, 16 October 2012

Next Best VGM Videos

Posted on 19:21 by Unknown
Hello, guys.

If I were to continue with my Best VGM series using something else than a downloader that downloads the YouTube videos before converting, this is what I would be importing. Here's a list of Best VGM videos I would actually make for the future:

136 Terminal Velocity - Stage 3 (Moon Dagger)
137 Road and Track Presents The Need For Speed - Control Central
138 SimCity 2000 - Subway Song
139 Blast Corps - Outland Farm (Ironstone Mine)
140 Beetle Adventure Racing! - Conventry Cove
141 Railroad Tycoon 3 - Intro
142 Riven: The Sequel To Myst - Intro
143 Motor Raid - Yendas
144 Nitrome Toxic 2 - Theme
145 Nitrome Square Meal - Theme
146 Iridion 3D - Credits
147 Iridion II - Azuki Canyon
148 LEGO Island - Brickster Chase
149 Pokemon Stadium - Title Theme
150 The Simpsons Hit and Run - Wrong Side of The Tracks
151 Super Smash Bros. Master Hand Battle
152 Ridge Racer Type 4 - Intro
153 Ridge Racer Type 4 - Grand Prix Intro (Real Racing Roots '99)
154 LEGO Island - Racetrack
155 Cruis'n USA - Beverly Hills
156 Dixie Kong's Quest - Boss Music
157 Mario Super Sluggers - Mario Stadium (Challenge Mode)
158 Super Monkey Ball 2 - Monkey Target Boss
159 Airport Tycoon 3 - Game Menu
160 Advance Wars - Andy's Theme
161 Mario Party - Mario's Rainbow Castle
162 Mickey's Speedway USA - Grand Canyon
163 Penny Racers - Track Creator

Please make a big contribution to this series by finding a way for me to get the music without having to waste so much download space and cause so much to pay.

I'll see you guys later!
Read More
Posted in | No comments

Computer Game Collection

Posted on 11:05 by Unknown
Hello, people!

Before I happen to leave this very foundation of Champlain College Saint-Lambert (that's where I'm learning to get what Quebecors call the Diplome d'Etudes Collegiales), I want to show five YouTube videos to tell you which games I have right now.

There has also been so many PC games that unfortunately, my dad scrapped them; we used to have more than 30 PC games, but this is what I have for now. However, we have most of console-based video games intact and even brought new ones over the years.

Click on the links below to watch them:
http://www.youtube.com/watch?v=KzaacJM2DvQ (at Mom's, video games)
http://www.youtube.com/watch?v=w8Fz_dFotOY (at Mom's, PC Games)
http://www.youtube.com/watch?v=70mGxIxPvZQ (at Dad's, PC Games)
http://www.youtube.com/watch?v=OhJ8uWn_Mq4 (at Dad's, PC Games, part 2)
http://www.youtube.com/watch?v=ywAwu6yCKQo (at Dad's, video games)

Enjoy the videos! Please leave comments and subscribe to my channel!
Read More
Posted in | No comments

Monday, 15 October 2012

DOS Games to Play

Posted on 19:11 by Unknown
Hello, people.

If there's one thing that I want to do when I have lots of money, it's to play full version DOS Games on my Windows PCs, XP, Vista, and 7.

The reality of those games is, they have helped change the perspective of what video games are today and how we are now entirely enthusiastic about them. There had been technological advances that have drive games to new levels; in addition, the pixels and the combination of low-resolution polygons and layers leaves the impression on how just fun games can be. In reality, they have a strong sense of nostalgia.

Here are the DOS Games I want to play when I have money:

Screamer 1, 2 and Rally

WipEOuT (by Psygnosis)
Grand Theft Auto
Duke Nukem 3D
Quake
Destruction Derby 1 and 2
DOOM
Road and Track Presents The Need For Speed and Special Edition
maybe SimCity 2000?
maybe Frontier Elite II?

There's also PC games I ought to play, including:
Carmageddon
Riven: The Sequel To Myst
Myst
realMyst
maybe SimTunes?


That's all the games I want to play for now; it's getting really late at night and want to sleep to get ready for tomorrow's textual analysis in my English class. Goodbye!
Read More
Posted in | No comments

Best VGM Series

Posted on 18:39 by Unknown
Hello, guys.

I want to present to you a series of YouTube imports of video game music, with some of them already recorded but in a form that unless you use the Free YouTube Downloader or an online converter, you can't really get the music from them.

In this series, I have imported 135 videos (with the last one uploaded on September 26th) onto YouTube since my debut back in August, with the most popular VGM video being the theme songs of Angry Birds.

The games where I imported at least one track includes the following:
Super Mario Land
Metroid Prime
Mario Party
Pokemon Red and Blue
Grand Theft Auto III
Final Fantasy X
... and many more!

Originally, the Best VGM series was created because it was supposed to be my punishment for not spending time uploading enough videos on YouTube in Fall 2011 and Winter 2012 to build an audience for my music videos, but when I went to my mom's house back on October 5, I was given a warning not to download too much because since I was using Free YouTube Downloader to get the music that I wanted to import, I had exceeded the limit for downloading and uploading and it made my mom earn a $50 fine.

So now the series is halted and until I can find a way for me to pay my mom some money [I can't get a job right now since I'm too busy with my college studies], the only way on how I can really pursue my dream of earning public recognition is by going through so many posts on my Blogger site or deliver a message about me living with autism and discussing my own personality so much that I would rather be part of society instead of being so selfishly suffocated and remain isolated and insulted by everyone else.

Click here to access the playlist and to watch the Best VGM videos: http://www.youtube.com/playlist?list=PLE3E62A641092A1E4

Here's a quick preview video of the series: http://www.youtube.com/watch?v=rw_YXCfbY10

By the way, if you guys have any idea to how I can download the music that I need without allocating the memory of the actual video that the Free YouTube Downloader needs before converting, please let me know.

Anyway, enjoy the videos!
Read More
Posted in | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • The Quebec Ministerial Exam of College English (English Exit Exam)
    Hello, everyone. How you doing? I'm good. There is some unfortunate news for me to deliver, though I am planning to try to work myself a...
  • String Letter Counter (JAVA Program)
    Hello, guys. This is another JAVA Program I want to share with you guys. It's a counter for a specific letter in an entered string strai...
  • The Asperger Computer: A Self-Published Guide on Asperger's Syndrome and Multimedia
    The Asperger Computer - A Self-Published Guide on Asperger's Syndrome and Multimedia by Gregory Desrosiers How is Asperger’s syndrome li...
  • The Asperger Computer (e-book) - Sample Paragraph
    This is the sample paragraph for my e-book adaptation of a speech I've delivered at my college, Champlain College Saint-Lambert, on May ...
  • The Asperger Computer - Table des matières et une sample
    Excusez-moi si il ya beaucoup d'erreurs avec l'écriture , j'ai dû utiliser un traducteur pour obtenir ce parce que je su...
  • Arcade Games to check out
    Hello, everyone. How you people doing? I'm okay, though I am feeling mightily frustrated and lazy to try to work on a lot of things befo...
  • Fundraising Project (To Autism Society Canada)
    Hi, everyone! How are you people doing? I am feeling tired and stuff, but there are a couple of things I want to bring up with you. Tomorrow...
  • JAVA Program: Number Loop (Experimental Program of the Timer class)
    Hello there. Here's another program I want to present to you: it's a self-running experiment that tests the Timer class provided in ...
  • JAVA Program: Command-based String Remover in Text Files
    Hello, everyone. Let me share with you the code on one of the programs I did back in March 2013, while doing my Data Structures class. This ...
  • JAVA Program: Military Time to Real Time
    Hello, people. How you doing? I'm really busy with my college homework, but I am working so hard to pass my courses and continue in my s...

Blog Archive

  • ▼  2013 (38)
    • ▼  August (2)
      • Fundraising Project (To Autism Society Canada)
      • A New Phone!
    • ►  July (9)
    • ►  June (12)
    • ►  May (12)
    • ►  April (2)
    • ►  January (1)
  • ►  2012 (24)
    • ►  December (13)
    • ►  November (3)
    • ►  October (5)
    • ►  September (1)
    • ►  August (2)
Powered by Blogger.

About Me

Unknown
View my complete profile