88 Topics
|
|
Hey there, Just hit a road block in my assignment. I won't concern you too much with the assignment itself but it's basically a number input operated menu with option's like "Display employee details" & "Input pay details." I'm up to a part where I need to get the section … |
|
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 … |
|
I have a class orders which has its instanced stored in a QMap/Map and has a Key:int, value:order pattern. Everything went fine until I started iterating through the map and accessing the functions of the class.First I was trying to print out the order objects values using it's getter methods … |
|
This tutorial is about extension methods in c# **What is an extension method** Sometimes it is necessary to add functionality to a library for which you do not own the source code and where using inheritance to subclass functionality is not viable. This problem can be overcome with the careful … |
|
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? |
|
Below is part of my code for a simple java game. I am trying to keep the most recent 10 scores and names of the game in the prevScore and prevScoreName arrays. Both return statements in the method come up as errors, saying it requires int[] and what is found … |
|
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 … |
|
I am running into and problem where I am trying to pass an element in an array to a method to calculate the tax that is owed but all I get as a result is 0, which is not right. Here is the writeline: Console.WriteLine("Taxpayer # {0} SSN: {1}, Income … |
|
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 … |
|
Hi guys well I have two class's 1 class for my methods and another class for my GUI. In my method class I have my update statements for my database and in my GUI class I have obviously my gui and all my buttons that will produce a result when … |
|
So my code is suppose to get information from the user and figure out how much funding the two professors get. My code runs twice but for some reason only the last entry is saved and outputted and my formula for calculating the new funding only outputs zero for some … |
|
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 … |
|
I have written a class to read a text file and write the data into a 2D array of max records x 12 fields. Now that I have this working, I need to be ablel to call this array from my other classes to perform different tasks on the data. … |
|
|
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 … |
i have problem about the output in this code, my output so only the index 0. how can i fix this. [code] public class d_2D { static double[][] d =new double[6][4]; static double[][] e= {{}, {0.0,0.6,0.0,0.0}, {0.0,0.2,0.5,0.1}, {0.0,0.2,0.5,0.4}, {0.0,0.2,0.5,0.7}, {0.0,0.0,0.0,0.9}}; static double[] avg= new double[4]; static double[] sum= new double[4]; … |
|
[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(); … |
|
Hey, I have been studying Java for a year in college and this year we started Object Oriented Programming. We have been givin some assignments and stuff but they all include creating Objects and Classes. Does anyone know of any good resources for Creating these as I am slowing down … |
|
So I have a placeholder question in the code that i am reviewing [CODE] { Console.Clear(); Console.WriteLine("{0,24}", "Calories Burned"); Console.WriteLine("\n{0,15}:{1,8:f1} hours", "Hours", hours); Console.WriteLine("{0,15}:{1,8:f1} minutes", "Minutes", minutes); Console.WriteLine("{0,6}:{1,8:f1} calories burned", "Calories Burned", CaloriesBurned); Console.ReadKey(); }[/CODE] I know the first half of the following code "{0,15}" , 0 is placeholder and … |
|
[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 + … |
|
Here unsystematic play with linked list structure Object Oriented style. If you have performance critical code, please do not use this but use the superb faster than list [URL="http://pypi.python.org/pypi/blist/"]blist module[/URL] (including sorted versions of main data structures). As OO newbie (though with some 30 years of other programming), I wanted … |
|
Ok I think im getting better at these but not quite still have these implicit convert from int to string problems and the usual "does not exist in the current context" dilemma. [CODE]/* * */ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Calories { class Calories { static … |
|
Hey guys. I am trying to write a programme (not using scanner class) which prints the smallest number in an external text file called README.txt. Anyway I included some explanation of what I am doing so hopefully it's clear. What this programme prints is 0.0, which is not even a … |
|
I implore you to ignore the poor formatting, ignore the overall functionality even; my problem lies with trying to call the Scanner scan within flow method from readBoolean and readBoolean2D methods. It says it cannot find variable scan. How can I access this variable? [CODE] import java.util.*; import java.io.*; public … |
|
So I am supposed to write a class that converts fahrenheit to celsius (& vice versa), calculates the volume of a sphere after a radius is entered, and calculates the hypotenuse of a right triangle, all using nothing but static methods. Here is what I have so far; [CODE]class Fun … |
|
|
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 … |
[CODE]public class GAME { boolean gamestatus = true; double amounts[] = {0, 0.01, 0.5, 1, 5, 10, 11, 14, 20, 300, 600, 150, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28 }; Briefcase briefcase[] = new Briefcase[27]; public void casesSetup(){ for (int i … |
|
Hi there guys I need your help so badly as I can't finish my program. The instructions are: create a console application that instantiates a class with a method that takes in a string of values converts upper case to lower case and vice versa. The method also returns the … |
|
Hi Guys, I was going through a [URL="http://www.daniweb.com/software-development/java/threads/374765"]thread[/URL] in this forum and there is one very good reply to this thread. In the past Ive never used such techniques to idetntify how many classes would I create in my program, thus my programs used to be complex. Can you suggest … |
|
So I have an array [CODE]String[] directions = {"n", "e", "s", "w"}; Random dirPick = new Random(); int rNum = dirPick.nextInt(4); String direction = directions[rNum];[/CODE] Now say that one of these doesn't exist and if it picks it I need to take it out of being able to be picked. … |
The End.