473,385 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

intro to VB.net assignment

I'm in an intro to VB.net class. I'm haveing trouble with this
assignment, if anyone could help me please let me know. thanks!

Coding Assignment 7-Chapter 8 OOP-CSCI-171 Intro to VB.NET

1. Create a Windows application that models a carton of eggs:

Define a public class and call it cEggCarton to model the egg carton.
Declare a module-scope object variable of type cEggCarton. Since we
want the object to persist throughout the life of the program,
instantiate the cEggCarton class in the object declaration using the
New keyword, e.g.,
Private mobjEggCarton As New cEggCarton
Private Sub Form1_Load(ByVal sender As ...
Remember to declare your object variable outside of a procedure.
So you will create a single instance of cEggCarton on startup to
contain ALL the information about the egg carton.
2. The check boxes represent the eggs. The program starts out with 12
eggs in the carton, so set this as the object state in class
cEggCarton's New() constructor method. The top row models eggs 1-6,
the bottom row models eggs 7-12. A check indicates an egg is present
(broken or not). Each time you uncheck or recheck, the total eggs
TextBox is updated.
3. When you click the Show Diagram button, the program displays a
message box with a two-line diagram showing a graphic (diagram, really)
of the egg carton, similar to the array of checkboxes. In class
cEggCarton, implement public, read only property .Get6By2Diagram, whose
data type is String. .Get6By2Diagram returns a single string
consisting of 6 characters, vbCrLf (as the 7th character), then 6 more
characters. The first 6 characters are eggs 1-6. The 2nd set of 6
characters are eggs 7-12.
a. For each character/position, the diagram will show:
i. "+" unbroken egg
ii. "0" no egg
b. At first, with 12 eggs:
c. After eggs 2, 3, and 11 are removed (unchecked):

4. On startup, VB my try to access your object before you have created
it. To avoid a run-time error, you will probably need to use the Is
Nothing Boolean condition. E.G., if MobjEggCarton is an object
(instance) of class cEggCarton, you could avoid this problem by coding
thusly:

If MobjEggCarton Is Nothing Then
'object not instantiated, do nothing
Else
'object has been created, proceed
MobjEggCarton.IsPresent(8) = chkEgg9.Checked
ShowEggCount()
End If

5. BEFORE YOU START CODING: Read the grading chart carefully as it
lists the required properties and methods.
Use the grading chart below to verify you have included all elements
to receive full credit:
6. Grading chart. 15 points will be awarded as follows:
(you will not receive any credit if your program does not load, has
syntax errors, or will not run)
a. point(s)-Title bar includes assignment # and your name.
b. Code is properly commented and indented, broken down:
i. point(s)-Comment block at top of each module with title,
description, etc..
ii. point(s)-Comment block after every procedure header, except
for even handling procedures
iii. point(s)-Other comments throughout code
c. 1 point(s)-Form size, form shape, and all control
sizes/shapes/layout/captions match the screen captures / prototype
d. 1 point(s)-Class cEggCarton's New() constructor initializes egg
carton to state of 12 eggs;
e. 1 point(s)-Class cEggCarton has a private instance variable that
tracks the presence of each of the 12 eggs, e.g., a 12-element Boolean
array.
f. 2 point(s)-Class cEggCarton has a Public Property .IsPresent that
returns or sets whether or not an egg is considered present. Data type
is Boolean. Note: Eggs can be taken out and put back.
g. 3 point(s)-Each time a check box value changes, the object state
is updated to reflect whether the selected egg is present or not, using
the object's .IsPresent() method.
h. 3 point(s)-Class cEggCarton has a Public Property .Get6By2Diagram
as described above.
i. 1 point(s)-Class cEggCarton has a Public method .EggCount() which
returns the number of eggs. Broken and unbroken eggs are counted.
Implement .EggCount() as a public function.
j. 1 point(s)-Each time a check box value changes, egg count display
is updated using the object's .EggCount() method.
k. Point(s) off for these items
i. Diagram does not correctly reflect missing eggs
ii. "Total eggs" TextBox does not correctly reflect the # eggs in
carton

Nov 13 '05 #1
2 2739

Chad wrote:
I'm in an intro to VB.net class. I'm haveing trouble with this
assignment, if anyone could help me please let me know. thanks!


Wow, you really are lost. First, Access does not use VB.net.
Second, I don't think you'll learn much if *we* do your homework.
Isn't that why you have it? If you're really lost, ask your
instructor. That's what he's there for.

Nov 13 '05 #2
yeah no kidding.
maybe you should major in something
easier like "general studies".

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Paul Rubin | last post by:
OK, I want to scan a file for lines matching a certain regexp. I'd like to use an assignment expression, like for line in file: if (g := re.match(pat, line)): croggle(g.group(1)) Since...
10
by: Andrew Koenig | last post by:
It has been pointed out to me that various C++ books disagree about the relative precedence of ?: and the assignment operators. In order to satisfy myself about the matter once and for all, I...
13
by: Alf P. Steinbach | last post by:
The third part of my attempted Correct C++ tutorial is now available, although for now only in Word format (use free Open Office if no Word), and also, it's not yet been extensively reviewed -- ...
35
by: nagy | last post by:
I do the following. First create lists x,y,z. Then add an element to x using the augumented assignment operator. This causes all the other lists to be changed also. But if I use the assignment...
20
by: TimeHorse | last post by:
I would like to gauge interest in the following proposal: Problem: Assignment statements cannot be used as expressions. Performing a list of mutually exclusive checks that require data...
6
by: shapper | last post by:
Hello, When styling a DIV as follows: <div id="intro" class="Intro">Some intro text</div> Should I use a class: ..Intro {...} Or:
1
by: annabel59 | last post by:
I made a Flash intro for my website but when I open it in IE7 it gives error : expected object. It works fine in Mozilla. This is the code of the index.html file : <html> <head>...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.