33 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Nathaniel10

I want to increase my knowledge of PHP by learning about classes. I wrote the following very simple test program. It works. But I would like to know improve it. I plan on writing more complex test programs and that won't be the time to iron out smaller issues. Thanks …

Member Avatar for diafol
0
441
Member Avatar for SkateX

Greetings, I'm working on a class project for fractions and I'm stuck and cannot figure out where to go from here. We have a mandatory driver file we aren't supposed to change. See below for example output and the output I am actually getting. **Sample Output** Enter numerator; then denominator. …

Member Avatar for Nutster
0
527
Member Avatar for AbstractEden

One of my assignments, that I already turned in, dealt with collecting a student's name and gpa, and storing the information in an array. Afterwards, we were asked to display the student's information in descending order based on their gpa. I was curious if anyone has any suggestions on improving …

Member Avatar for stultuske
0
4K
Member Avatar for theashman88

I know this has been asked before, but I can't find any simple answers for a noob like me in C#. What exactly is a static method. I mean what does it mean to be static vs. nonstatic. I know in the code with the main method we use `public …

Member Avatar for RichardGalaviz
1
305
Member Avatar for lionaneesh

**Introduction** Hi guyz today I am going to writing a tutorial on dictionaries in Python....As per as getting comments from my readers I'll try to make this tutorial short.... **Layout** 1.What are dictionaries? 2.Why dictionaries? 3.How to declare/make dictionaries in Python? 4.What all you can do with a dictionary? 5.Interesting …

Member Avatar for vegaseat
0
656
Member Avatar for CoilFyzx

Hello good afternoon. I have successfully serialized data in the past, however it seems as if I don;t fully understand the process. I have a class called ProgramState which stores a variable (called lastCreated) with custom class LinesProject and an ArrayList variable(called recentProjects) of this custom class. The purpose of …

Member Avatar for CoilFyzx
0
372
Member Avatar for StephenopolousINC

Hello I am trying to create a class that called Lootable and create subclasses such as trunk, locker, etc. that will contain items that can be looted, they will inherit their lootability from the Lootable class. I am thinking of using the ArrayList for this. I have thought of different …

Member Avatar for StephenopolousINC
0
924
Member Avatar for Pyler

I'm trying to create a list stack that implements some interface called SomeList The list stack should only use stack with no links. the itnerface has a number of methods that I would like to implement. So for SomeList I have something like public interface SomeList<T>{public void plus(T something);public E …

Member Avatar for JamesCherrill
0
402
Member Avatar for pwolf

Hello, I'm trying to program a basic program at the moment and have run into some difficulties. I have a method as follows: public static void loadDB() { // load data into datasets - this will be called on form2 the login screen loadTblStaff(); loadTblCars(); } the method is called …

Member Avatar for ddanbe
0
247
Member Avatar for pwolf

I have been struggling with this since yesterday and I really need to get it finished. I have no clue why its not working. THe porblem im facing at the moment is as follows: I have a method loadDB(); That is looks like this: public static void loadDB() { // …

Member Avatar for pwolf
0
259
Member Avatar for joseph.lyons.754

Hey Guys, So I was doin a tutorial and I incorporated it into my code and it works for the most part. The program gives you a list of town names you pick one and hit search. All good so far then the program goes into the database and pulls …

Member Avatar for joseph.lyons.754
0
278
Member Avatar for xHellghostx

For example let's say we have the property called Customer that returns a value of name String name; <== Global Variable public String getName() { return name; } public String setName(holdingName) { name=holdingName; } and a constructor called Match public FullName(String realName) { holdingName = realName; } Can I do …

Member Avatar for stultuske
0
313
Member Avatar for Lindsey1211

Im trying to call the method "public void insertCard(int p)" within the same class into the method " public void deposit (double amount) " My code for both methods is displayed below. the objective would be to have the deposit method return the last print statement if the card is …

Member Avatar for csstu
0
252
Member Avatar for popeyemissy

I need to fix the code. Once a war event takes place, no points are assigned however in the next deal whoever wins (be it the player or computer) should get double points. One point for the war and the second point for the next deal that was won as …

Member Avatar for JamesCherrill
0
311
Member Avatar for Pyler

Do you need to implement a class in order for an object to access the class's functions/methods? When should you implement a class? When shouldn't you?

Member Avatar for rubberman
0
338
Member Avatar for SCass2010

Hi everyone, I'm currently trying to do a bit of java programming after not looking near it for almost a year. Most of what I've been doing has been C/C++, and I was just wondering - in C++ you could have a header file with functions only in it, say …

Member Avatar for SCass2010
0
362
Member Avatar for DavidKroukamp

Hey all, I have been busy building my own chess game and as of now im a bit stomped. Well you see i have an object Board, this object will be initiated and it will create a new frame with various panels one of them being the panel which holds …

Member Avatar for JamesCherrill
1
241
Member Avatar for jpsider

Hi all, I'm working on a school project and I am running into a problem, possibly more... This is my first post, so I am sorry if it ends up ugly. Here is a description of the project: This project focuses on demonstrating your understanding of classes and objects. Before …

Member Avatar for Philippe.Lahaie
0
9K
Member Avatar for begueradj

Hello people, I designed this class: [CODE] package aiproject; /* * This class has the task to read the data stored in a file called "fichier.txt" * line by line. * The read lines will be put inside a List called lignesDeMonfichier * Also, this class counts the number of …

Member Avatar for JamesCherrill
0
315
Member Avatar for rahul.ch

[CODE]class Mammal { String name = "furry"; String makeNoise() { return "generic noise";} } class Zebra extends Mammal { String name = "stripes"; String makeNoise() { return "bray";} } public class Zoo { public static void main (String[] args) { new Zoo().go();} void go() { Mammal m = new Zebra(); …

Member Avatar for rahul.ch
0
150
Member Avatar for niall.lennon2

[CODE]class Date { private int day, month, year; // the date Date(int d, int m, int y){ day = d; month = m; year = y; } Date(){ }; void get() { day = Console.readInt(); month = Console.readInt(); year = Console.readInt(); } void put(){ System.out.println(day + "/" + month + …

Member Avatar for Ezzaral
0
165
Member Avatar for alliswim2010

Hello I'm having major issues, please help me with this code; (Generating random characters) Use the methods in RandomCharacter to print one hundred uppercase letters and then one hundred single digits, and print ten per line. Use these methods: public static char getRandomUppercaseLetter(){ return getRandomCharacter('A', 'Z'); } public static char …

Member Avatar for alliswim2010
0
689
Member Avatar for terexberd

Hey guys, i just wanted to know the codes for ArrayList class methods such as .clear() .add() .size() .isEmpty() etc... Your help will be appreciated!

Member Avatar for terexberd
0
211
Member Avatar for progr

I am having problems accessing a variable from one class to another. [CODE] class Player(pygame.sprite.Sprite): def rotateShip(self, rotAmt): radians = self.rotation * math.pi / 180 [/CODE] I am trying to use the variable radians from class Player to another class. radians only exists in 'rotateShip'. Thanks for your help in …

Member Avatar for Gribouillis
0
151
Member Avatar for KenyanRaphael

I've been teaching myself java using youtube videos of Starnford Engineering Everywhere. So far its been good, till the code started getting complicated and i got stuck. I need advice on how best to learn java.

Member Avatar for KenyanRaphael
0
217
Member Avatar for adanaz

Hi guys I'm trying to take a user input (name) and replicate the input in other methods. Can anybody help? Here is the code: [CODE]import javax.swing.JOptionPane; public class example { public static void main (String[]args) { entername(); } public static void entername() { String a=""; a = JOptionPane.showInputDialog("Welcome. Enter name …

Member Avatar for adanaz
0
955
Member Avatar for Oregand

Hey guys, im just learning how to use methods but I really cant seem to understand them. We have a question where we have to write a program for the following game. There is a little known dice game which is played with a pair of dice and has the …

Member Avatar for Oregand
0
3K
Member Avatar for Oregand

Hi guys, Im pretty new to programming so bear with me if you think this is baby stuff:P Ive just been introduced to methods last weeks and after a week of study Im no better at understanding them. The problem is I just seem to grasp how to you them …

Member Avatar for Oregand
0
129
Member Avatar for doctorjo5

I'm having trouble figuring out a few different methods that I'm putting into a constructor. Any chance for advice? I'm having trouble with the last 3 near the bottom. I want to compare two name variable to each other to see if they are the same regardless of case, then …

Member Avatar for NormR1
0
199
Member Avatar for Iamthecheese

Hello, I'm working on an assignment due next week and I'm having quite a bit of trouble. The program is to ask the user for input of a double until they desire to stop. That part, I imagine will be in the Test file. The master file is to store …

Member Avatar for NormR1
0
185

The End.