473,669 Members | 2,414 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I dont understand this!!

22 New Member
I was just wondering, my teacher assigned a project for me and told me to "create one cat in SandBox and put all the methods (for example method_1) you need for the excercises in KittyKitty and call then (one at a time) from SandBox" and to turn in only one sandbox and one kittykitty, how if there are 6 assignments??? I dont understand!!!
Nov 3 '06 #1
5 1829
sicarie
4,677 Recognized Expert Moderator Specialist
I was just wondering, my teacher assigned a project for me and told me to "create one cat in SandBox and put all the methods (for example method_1) you need for the excercises in KittyKitty and call then (one at a time) from SandBox" and to turn in only one sandbox and one kittykitty, how if there are 6 assignments??? I dont understand!!!
It sounds like your teacher wants you to create one class 'SandBox' that instantiates another class 'Cat,' and call the methods from there.

Expand|Select|Wrap|Line Numbers
  1. public class Cat {
  2.  
  3.    // method_1 -> method_6 here
  4.  
  5. }
  6.  
  7. public class SandBox {
  8.  
  9.    Cat KittyKitty = new Cat();
  10.  
  11.    System.out.println(KittyKitty.method_1());
  12.  
  13. }
  14.  
  15.  
Or you could put the method results in variables if they returned something, and manipulate them from there. Does that seem to fit with what your teacher was saying?
Nov 4 '06 #2
ryann18
22 New Member
It sounds like your teacher wants you to create one class 'SandBox' that instantiates another class 'Cat,' and call the methods from there.

Expand|Select|Wrap|Line Numbers
  1. public class Cat {
  2.  
  3.    // method_1 -> method_6 here
  4.  
  5. }
  6.  
  7. public class SandBox {
  8.  
  9.    Cat KittyKitty = new Cat();
  10.  
  11.    System.out.println(KittyKitty.method_1());
  12.  
  13. }
  14.  
  15.  
Or you could put the method results in variables if they returned something, and manipulate them from there. Does that seem to fit with what your teacher was saying?
Yeah that fits but how would I put only one sandbox on there if I have 6 exercises to plug in??
Nov 4 '06 #3
r035198x
13,262 MVP
Yeah that fits but how would I put only one sandbox on there if I have 6 exercises to plug in??
What six exercises are you talking about?
Nov 4 '06 #4
ryann18
22 New Member
What six exercises are you talking about?
Those six that I had posted before, the ones that you helped me with.
Nov 4 '06 #5
r035198x
13,262 MVP
Those six that I had posted before, the ones that you helped me with.
Simply put all the methods in the cat class and call them in SandBox as explained by sicarie.
Nov 6 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1707
by: Merrua | last post by:
I dont understand how to do this I created a dialog based project and that is fine for most of my programming project, but one dialog box is going to generate a graph, and as far as i know from my books that requires a view? I can add a view to my project but i dont see where i add a frame and doc? Or can i add a view to a normal dialog box? (I dont think i can do this but if i could it would be handy Im using visual c++ 6.0...
3
1918
by: Sheau Wei | last post by:
This is the code the code that i try to run it as my search engine for my database. But i dont understand why i run a notice that undefind index. Can u help me ? <form method="post" action="search.php"> <input type="text" name="search" size=25 maxlength=25> <input type="Submit" name="Submit" value="Submit"> </form> <? //connect to server mysql_pconnect("localhost","root","password");
19
2246
by: so many sites so little time | last post by:
the table is head the colunm is called body <?php //show_site.php // This script retrieves blog entries from the database. // Address error handing. ini_set ('display_errors', 1); error_reporting (E_ALL & ~E_NOTICE); // Connect and select.
2
1846
by: Sean Hammond | last post by:
Anyone understand this? Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02) on linux2 Type "help", "copyright", "credits" or "license" for more information. .... """Send 'input' (string) to the markdown perl script, and return the .... output from markdown (string). .... .... input: a string of markdown-formatted text, including \n's at
1
1498
by: abubakarm | last post by:
Hi, I accidentally wrote this: if (1, 2); and it compiles fine. I want to know why is it correct and what does it mean in c++. The compiler i'm using in visual C++ 2k5. Regards,
6
1477
by: Bishop | last post by:
a += (UInt32)(url + (url << 8) + (url << 16) + (url << 24)); I'm trying to understand what the above line of code does. I understand that the url part of (url << 8) returns part of the string but I don't understand what the << 8 does.
5
1731
by: dynamo | last post by:
In the following program i dont how cin knows where day, stops and ch ,starts. The same thing for month and year. When you type the input string without spaces.Can anyone help?thanks #include <iostream.h> int main (void) { int day, month, year; char ch; cout << "Input a date as dd/mm/yy: "; cin >> day >> ch >> month >> ch >> year;
3
2437
by: canabatz | last post by:
Hello all!! i got a small problem ,not big :) i got this example of a link in my site that display everything correctly! http://www.mysite.com/product.php?id=200 now my problem is : if change the id by hand to id that is not exist ,then all the page is getting a big mess because there is no data to show!!
0
8465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8383
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8894
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8803
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8587
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2029
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.