Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C# Project (1)
#1
Make a console or windows app that inputs a users birthdate and outputs their age.

This program should have comments as well as error catching.

Best program wins a cookie.

Overview:
  • Figure out the age of the person from date inputted.

Notes:
  • Application can be either console or windows application.
Reply
#2
Windows Form Application.
Reply
#3
Toast Wrote:Windows Form Application.

++ my vote

I'm 16 years, 4 months, and 18 days old.
Reply
#4
Do you mind if I do it in Java?
Reply
#5
Yeah , you can do it in Java.
Reply
#6
I tried doing this in VB.net and I have a problem with enum's I used Toast's code as a reference but I get a problem with this line of code

Code:
[Enum].Parse(GetType(eMonths), CMB_Month.Text)


and the error I get
Quote:Must specify valid information for parsing in the string.
Reply
#7
Very nice work toast and james. Toast, I like that your project works on events besides a normal button click event
Reply
#8
Thanks, it's not that hard to do lol.
Reply
#9
I wrote mine in java.. I also made a custom coded from scratch swing GUI and a JNLP file, so if you wanna learn any of that read through my code =).

Ageulator.java
[code]
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.SwingUtilities;
import javax.swing.JOptionPane;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.Calendar;

// The main frame, all the gui elements go on here
class MainFrame extends JFrame implements ActionListener {

Calendar m_calendar = Calendar.getInstance();
JComboBox m_birthMonth = new JComboBox();
JComboBox m_birthDay = new JComboBox();
JComboBox m_birthYear = new JComboBox();

// Create and show the main frame
public MainFrame() {
// Close the application when we exit
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(true);
this.setTitle("Ageulator");
// Create all the components on the main frame
this.createGUI();
// Remove any extra space between components
this.pack();
// Start application in the center of the screen
this.setLocationRelativeTo(null);
this.setVisible(true);
}

// Create all the components and put them on the main frame
private void createGUI() {
// Simple GUI layout manager
this.setLayout(new BorderLayout());
m_birthMonth.addItem("--");
// Allow the user to select months 1-12
for (int i = 1; i
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)