Search This Blog

Monday, January 30

Assignment 4!

ONLY ONE MORE TO GOOOO!!!!

This one will be an easy one!

ELET 4309

Assignment 4 (10 Points)

Description

Write a Java GUI program that allows users to convert a Fahrenheit value to a Celsius value, and vice versa.
The layout of the UI components is displayed in 2 figures below.
The following 2 figures also show entered values and converted values for the chosen conversion option. 


Fahrenheit to Celsius Conversion



Celsius to Fahrenheit Conversion

HAPPY CODING!!!

~Minela

Friday, January 27

Friday Diary 8, Feeling Uninspired

Dear Readers,
I know my blog has been lacking in content, especially compared to how strongly this year (2012) started off. Honestly, I've been feeling quite uninspired since arriving back home from my cruise.

I don't know why I think I was just anxious to start my new job, which I have! I'm ABSOLUTELY loving the company I'm fortunate enough to be working for. :) Anyway, I can't speak much to my role as I've just started and am still in the training process, but I love the company culture and the fact that I work for a company that is NOT hesitant to move forward with new technology and trusts its employees not to abuse the liberties afforded them! I'm in L-O-V-E!!!!!

In other news, I FINALLY purchased a new mattress. (This has been in the works for at least 2 months) I went with the iComfort Genius (the 2nd most firm option) and am sleeping on it for the first time tonight! Maybe I'll do a review!!!!!

That's all for now. Sorry if this post comes off as a piss poor attempt at British English, I've been reading Confessions of a Shopaholic on my Kindle (for the past 3 hours) and am about 80% of the way through and the story is FINALLY starting to amp up so I can't wait to finish it. (I just HAD to get this post published before midnight though, how committed am I?)

Hugs & Kisses,
MINELA

!ANSWER 3! Notebook

public class Notebook extends Computer {
 static int dScreenSize;
 
 public Notebook(String maufacturer, String model, int drivecap, int screenSize, String color, double price) {
  super(maufacturer, model, drivecap, color, price);
  dScreenSize = screenSize;
 }
 public int getscreensize(){
  return dScreenSize;
 }
 public void setscreensize(int screenSize){
  dScreenSize = screenSize;
 }
 @Override
 public String toString() {
  return String.format("\nDesktop Computer\n\nManufacturer: %s\nModel: %s\nCPU:\n\tType: %s" +
    "\n\tSpeed: %f\n\tCache: %d\n\tFSB: %d\nHard Drive: %d\nScreen Size: %d\nColor: %s\nPrice: %f\n", 
    getmanufacturer(), getmodel(), cpu.gettype(), cpu.getspeed(), cpu.getcache(), cpu.getFSB(), gethardDrive(), 
    this.getscreensize(), getcolor(), getprice());
 }
}

Thursday, January 26

!ANSWER 3! Desktop

public class Desktop extends Computer {
 static int raidLevel;

 public Desktop(String maufacturer, String model, int drivecap, String color, int raid, double price) {
  super(maufacturer, model, drivecap, color, price);
  raidLevel = raid;
 }
 public int getraid(){
  return raidLevel;
 }
 public void setraid(int raid){
  raidLevel = raid;
 }
 
 @Override
 public String toString() {
  return String.format("\nDesktop Computer\n\nManufacturer: %s\nModel: %s\nCPU:\n\tType: %s" +
    "\n\tSpeed: %f\n\tCache: %d\n\tFSB: %d\nHard Drive: %d\nRaid Level: %d\nColor: %s\nPrice: %f\n", 
    getmanufacturer(), getmodel(), cpu.gettype(), cpu.getspeed(), cpu.getcache(), cpu.getFSB(), gethardDrive(), 
    this.getraid(), getcolor(), getprice());
  }

}

Wednesday, January 25

!ANSWER 3! CPU Class

public class CPU {
 private String type;
 private float speed;
 private int cCache, cFsb;
 
 public CPU (String CPUtype,float CPUspeed, int cache, int FSB){
  type = CPUtype;
  speed = CPUspeed;
  cCache = cache;
  cFsb = FSB;
 }
 public String gettype()
 {
  return type; 
 }
 public void settype(String CPUtype){
  type = CPUtype;
 }
 public float getspeed()
 {
  return speed;
 }
 public void setspeed(float CPUspeed)
 {
  speed = CPUspeed;
 }
 public int getcache()
 {
  return cCache;
 }
 public void setcache(int cache)
 {
  cCache = cache;
 }
 public int getFSB()
 {
  return cFsb;
 }
 public void setFSBe(int FSB)
 {
  cFsb = FSB;
 }
}

Tuesday, January 24

!ANSWER 3! Computer Class

import java.util.ArrayList;
import java.util.Scanner;


public abstract class Computer {
 private String cManufacturer;
 private String cModel;
 private String cColor;
 private int hardDrive;
 private double cPrice;
 protected CPU cpu;
 private boolean isPowerOn = false;
 
 public Computer (String maufacturer,String model, int drivecap, String color, double price){
  cManufacturer = maufacturer;
  cModel = model;
  hardDrive = drivecap;
  cColor = color;
  cPrice = price;

 }
 public String getmanufacturer()
 {
  return cManufacturer; 
 }
 public void setmanufacturer(String manufacturer){
  cManufacturer = manufacturer;
 }
 public String getmodel()
 {
  return cModel; 
 }
 public void setmodel(String model){
  cModel = model;
 }
 public int gethardDrive()
 {
  return hardDrive; 
 }
 public void sethardDrive(int drivecap){
  hardDrive = drivecap;
 }
 public String getcolor()
 {
  return cColor; 
 }
 public void setcolor(String color){
  cColor = color;
 }
 public double getprice(){
  return cPrice;  
 }
 public void setprice(double price){
  cPrice = price;
 }
 public void setCPU(CPU cCpu){
  cpu = cCpu;
 }
 
 public boolean getpower(){
  return isPowerOn;
 }
 
 public void start(){
  isPowerOn = true;
 }
 public void shutdown(){
  isPowerOn = false;
 }
 
}

Monday, January 23

!ANSWER! Assignment 3

Here it comes the ANSWER TO the difficult number 3!...

Are you ready?

BRACE YOURSELF....its going to be a long and bumpy one!

import java.io.*;
import java.util.*;

public class BajrovicAssignment3 {
 static ArrayList<Computer> computers = new ArrayList<Computer>();
 
 public static void main(String[] args){
 
 while(true){
  Scanner menuin = new Scanner(System.in);
  String[] menu = new String[6];
  menu[0] = "Choose one of the following options:";
  menu[1] = "i (Input Computer info)";
  menu[2] = "d (Display Computer info)";
  menu[3] = "s (Start a computer)";
  menu[4] = "u (Shutdown a computer)";
  menu[5] = "q (Quit Program)";
 for (String m : menu) //prints the entire array with only 1 system.out
  System.out.println(m);
 String menuchoice = menuin.nextLine();
 
 if (menuchoice.equals("i")){
   Scanner compmenuin = new Scanner(System.in);
   String[] compmenu = new String[3];
   compmenu[0] = "Choose one of the computer types listed below:";
   compmenu[1] = "1. desktop computer";
   compmenu[2] = "2. notebook computer";
  for (String c : compmenu) //prints the entire array with only 1 system.out
   System.out.println(c);
  int compchoice = compmenuin.nextInt();
   switch (compchoice){
    case 1:
     desktopinput();
     break;
    case 2:
     notebookinput(); 
     break;
    }  
 }
 else if (menuchoice.equals("d")){
  Scanner index = new Scanner(System.in);
  System.out.print("Enter a computer number to be displayed: ");
  int ind = index.nextInt() ;
  
  System.out.print(computers.get(ind));
  
  if (computers.size() == 0){
   System.out.println("\nThere are no computers created.\n");
  }

  }
 
 else if (menuchoice.equals("s")){
  if (computers.size()==0){
   System.out.println("You haven't created any computers.");
  }
  else{
  Scanner index = new Scanner(System.in);
  System.out.print("Enter a computer number to be started: ");
  int ind = index.nextInt() ;
  Computer starter = computers.get(ind);
  
  if (starter.getpower() == false){
  starter.start();
  System.out.format("%s %s has been started.\n", starter.getmanufacturer(), starter.getmodel());
  }
  else if (starter.getpower() == true){
   System.out.println("This computer is already on.");
  }
   
 }
 }
 else if (menuchoice.equals("u")){
  if (computers.size()==0){
   System.out.println("You haven't created any computers.");
  }
  else{
  Scanner index = new Scanner(System.in);
  System.out.print("Enter a computer number to be started: ");
  int ind = index.nextInt() ;
  Computer shutter = computers.get(ind);
  
  
  if (shutter.getpower() == true){
  shutter.shutdown();
  System.out.format("Shutting Down\n");
  }
  else if (shutter.getpower() == false){
   System.out.println("This computer is already off.\n");
  }
  }
 }
 else if (menuchoice.equals("q")){
  System.exit(0);
 }
 
 else{
    System.out.println("Invalid Selection.");
   }
  }
 } 
//  }

 public static void desktopinput(){
  Desktop c1 = new Desktop (null, null, 0, null, 0, 0);
  CPU c3 = new CPU (null, 0, 0, 0);
  
  
  Scanner compin = new Scanner(System.in);
  System.out.println("Enter manufacturer:");
  String manufacturer = compin.nextLine();
  c1.setmanufacturer(manufacturer);
  System.out.println("Enter model:");
  String model = compin.nextLine();
  c1.setmodel(model);
  System.out.println("Enter CPU type:");
  String CPUtype = compin.nextLine();
  c3.settype(CPUtype);
  System.out.println("Enter CPU speed (GHZ):");
  float CPUspeed = compin.nextFloat();
  c3.setspeed(CPUspeed);
  System.out.println("Enter CPU cache (MuB):");
  int cache = compin.nextInt();
  c3.setcache(cache);
  System.out.println("Enter FSB (MHZ):");
  int FSB = compin.nextInt();
  c3.setFSBe(FSB);
  System.out.println("Enter hard drive capacity (GB):");
  int drivecap = compin.nextInt();
  c1.sethardDrive(drivecap);
  System.out.println("Enter color:");
  String color = compin.next();
  c1.setcolor(color);
  System.out.println("Enter raid level:");
  int raid = compin.nextInt();
  c1.setraid(raid);
  System.out.println("Enter price ($):");
  double price = compin.nextDouble();
  c1.setprice(price);
  
  c1.setCPU(c3);
  computers.add(c1);
  System.out.print(computers.get(0));
//  System.out.format("%s %s has been created.", c1.getmanufacturer(), c1.getmodel());
 }
 public static void notebookinput(){
  Desktop c1 = new Desktop (null, null, 0, null, 0, 0);
  CPU c3 = new CPU (null, 0, 0, 0);
  
  
  Scanner compin = new Scanner(System.in);
  System.out.println("Enter manufacturer:");
  String manufacturer = compin.nextLine();
  c1.setmanufacturer(manufacturer);
  System.out.println("Enter model:");
  String model = compin.nextLine();
  c1.setmodel(model);
  System.out.println("Enter CPU type:");
  String CPUtype = compin.nextLine();
  c3.settype(CPUtype);
  System.out.println("Enter CPU speed (GHZ):");
  float CPUspeed = compin.nextFloat();
  c3.setspeed(CPUspeed);
  System.out.println("Enter CPU cache (MuB):");
  int cache = compin.nextInt();
  c3.setcache(cache);
  System.out.println("Enter FSB (MHZ):");
  int FSB = compin.nextInt();
  c3.setFSBe(FSB);
  System.out.println("Enter hard drive capacity (GB):");
  int drivecap = compin.nextInt();
  c1.sethardDrive(drivecap);
  System.out.println("Enter color:");
  String color = compin.next();
  c1.setcolor(color);
  System.out.println("Enter raid level:");
  int raid = compin.nextInt();
  c1.setraid(raid);
  System.out.println("Enter price ($):");
  double price = compin.nextDouble();
  c1.setprice(price);
 
  c1.setCPU(c3);
  computers.add(c1);
  
  System.out.format("%s %s has been created.", c1.getmanufacturer(), c1.getmodel());
 } 
}

Now, because this assignment requires you to create separate classes to handle the storage & processing of the different types of user input (Computer, CPU, etc.) I will post the code for each class separately to avoid having JUMBO posts. (She says after posting ~200 lines of code)

I will post each class daily this week in this section so that next Monday you will have Assignment 4!!! (Only 2 more to go)

HAPPY CODING!

Friday, January 13

Friday Diary 7... Just another Friday

Ok, I just HAD to get that out there! As you know I graduated in December. Since then:
  • My aunt threw me a surprise grad party
  • My parents threw me a grad party
  • My family from out-of-town came to my grad party
  • My aunt (from Florida) gifted me an iPad, because she wanted to buy me something special and useful for work (I was planning on using my 'gadget/work-life balance' bonus for this purpose)

I'm on a cruise through Monday (that's why there will be no post on Monday the 16th)

~Minela

Wednesday, January 11

Grad Party Haul

These are the honorable mentions (gifts) from my graduation party...
iPad
Apple
Kindle Touch
Amazon
'Treasure Hunt' @ MoneyGram

Red, Black & Zebra Scarf
CATO


And for the sappy love song...
My Surprise Grad Party







Monday, January 9

Grad Party!

So, my grad party from my parents was this past Saturday.




Cake Monster face!

Another post on the more remarkable gifts I received coming soon! (Enjoy the pictures for now)

~Minela

Friday, January 6

Friday Diary #6, Another Tech Recap


I decided to use this opportunity to post a couple of my favorite links. I chose more recent posts (I stared a few earlier in the week but since tech blogs move at the speed of light those are old news)

1. Arduino lamp
Same as last week, basically an eighth grader's science fair project, but its neat and I'm planning to build myself one. (I will definitely post the results)
2. Core i7 clocked at 5.6GHZ
What is there really to say about this? Its magical, I actually felt myself salivating as I read this article. A MUST READ!
3. CES 2012
I want to attend, seems like an IMATS for tech geeks. This is my first encounter with CES (I'm sure that's shameful) so I need to dig up more dirt but I'm excited to find out more.

In  other news, I'm going to start studying for my MCITPE certification, a requirement for my new job, but I have very little to report as I've just started. Refer to Microsoft for more info.

~Minela

Wednesday, January 4

Shoe Haul!

Yay!!!! A shoe haul!

So, I thought I'd share with you some of my recent shoe purchases...then I saw how many there were and I was discouraged. But no matter, we press on!

The suspects (minus the Shoemint pair)

Work
These two are from Macy's (purchased the day AFTER Christmas, yes it was crazy ;) )
 Both of these are for work, since I will be going to Seattle in the middle of February, I need some warm yet comfortable yet well soled shoes to keep my toesies warm and my butt off the floor! ;)
 These were 69.99, but they are marked down even lower and I got them for ~50

SHOEMINT
 These are my Shoemint purchase for December, I'm still making my mind up about Shoemint. I tried Jewelmint before it was all the craze and was very disappointed, so I'm hesitant about the 'mint' brands. I will do a full review once I have a couple more pairs and I make up my mind!
 Still these are not bad and considering the heel they are surprisingly comfortable the platform is a solid 1.5" on a 5.5" heel, so you are getting the height without the pain!
As with all Shoemint purchases they were 79.99 a pair, but new customers get 20% off! 

Random Offenders
From Ross, 29.99 
 Both of these are from Forever 21, total was ~46

Yes this is sickening, but HEY! a woman's gotta have her shoes, right?

~Minela

Monday, January 2

Homework #3

How've you been doing?

This next one is a douse...so I'm going to give you 2 weeks to complete it!

Remember to check out the ELET 4300 website for the full assignment, but here's a preview.


Choose one of the following options:
i (Input Computer info)
d (Display Computer info)                   
s (Start a computer)
u (Shut down a computer)
q (Quit program)

D                                                                       // user input using a keyboard
Enter a computer number to be displayed: 1
*********************************
No computer has been created.
*********************************

Choose one of the following options:
i (Input Computer info)
d (Display Computer info)                   
s (Start a computer)
u (Shut down a computer)
q (Quit program)

i                                                                            // user input using a keyboard
Choose one of the computer types listed below:
1. desktop computer
2. notebook computer

1                                                                           // user chooses to build a desktop      
Enter manufacturer: Dell
Enter model: Inspiron
Enter CPU type: Intel Core 2 Extreme
Enter CPU speed (GHZ): 3.2
Enter CPU cache (MB): 4  
Enter FSB (MHZ): 1066
Enter hard drive capacity (GB): 250
Enter color: Black
Enter raid level: 1
Enter price ($): 2050

Dell Inspiron was built successfully!                         // message at the end of each computer creating


Choose one of the following options:
i (Input Computer info)
d (Display Computer info)                   
s (Start a computer)
u (Shut down a computer)
q (Quit program)

// continue building desktop or notebook computers
.
.


Enter a computer number to be displayed: 0        // print out info of 1st computer on the list
*********************************
Desktop Computer
Manufacturer:  Dell
Model: Inspiron
CPU:
            Type: Intel Core 2 Extreme
            Speed: 3.2 GHZ
            Cache: 4MB
            FSB: 1066MHZ
Hard Drive: 250 GB
Color: Black
Raid Level: 1
Price: $2050.00
*********************************

Enter a computer number to be displayed: 2        // print out info of 3rd computer on the list
*********************************
Notebook Computer
Manufacturer:  HP
Model: dv-6000t
CPU:
            Type: AMD Athlon 64
            Speed: 3.2 GHZ
            Cache: 4MB
            FSB: 1066MHZ
Hard Drive: 250 GB
Screen Size: 17 inches
Color: Silver
Price: $2499.00
*********************************

S                                                                         // start up a desktop or notebook computer
Enter a computer number you wish to start: 0
*********************************
HP dv-6000t has been started.

.
.
.
Happy Coding!