65 Topics

Member Avatar for
Member Avatar for viktor.baert

Hello, I'm trying to make a very basic + - calculator in java using constructors after watching thenewboston video tutorial I tried to experiment with it. My litle project is almost finished my only problem is that the boolean I use is being reset after I assign it. If someone …

Member Avatar for viktor.baert
0
932
Member Avatar for wab9jon

Hello I cant figure out how to recive a boolean from a method in another class. public boolean arYatzy() { boolean yatzy = true; for (int i = 0; i < tarn.length - 1; i++) { yatzy = yatzy && (tarn[i] == tarn[i + 1]); } if (yatzy) { return …

Member Avatar for wab9jon
0
210
Member Avatar for |-|x

Does anyone know a good way to force javascript to evaluate all operands in a boolean expression? In particular, what I am tring to do is essentially this: return isValid(a) && isValid(b) && isValid(c); while this technically does work, the function is responsible for highlighting invalid areas on the form …

Member Avatar for |-|x
0
427
Member Avatar for hous3aholik

Im trying to create a deck of cards using enums. I already have my enum declared, but I'm stuck in how exactly to create the deck of cards using a boolean array. So far i tried to initialize my constructor, but I don't know what direction to take now. Any …

Member Avatar for JamesCherrill
0
710
Member Avatar for Yoink

Hi, I have a program that deals with stacks and queues in python. Part of the program compares items in 3 stacks that contain objects. The loop will run and compare all items in the top of the stacks and pop the item that has the highest value and appends …

Member Avatar for scudzilla
0
260
Member Avatar for c++bob1234

#include<iostream> using namespace std; #include<string> #define INT_MAX 100000 #define INT_MIN 0 using namespace std; class Automobile { public: Automobile(); void read(); bool is_cheaper_than(??????) const; bool better_mileage_than(???????) const; bool better_finanace_than(??????) const; void print() const; private: string name; float price; float mileage; float finance; }; Automobile::Automobile() { name=" "; price=INT_MIN; mileage=INT_MAX; } …

Member Avatar for Saith
0
292
Member Avatar for pattmorter

I am working on a practice exam right now and I came across a write-your-own code problem that I can't figure out. The question is: > Modify your first function. In addition to returning the greatest value by pass-by-value, you should also sent a true/false value back to main() if …

Member Avatar for pattmorter
0
213
Member Avatar for rupes0610

I have a Sudoku puzzle and I need to make sure that each row and column have each number 1 through 9. What is the easiest way of doing this? The code snippet that I have so far is below. public static boolean rowsAreValid(int[][] array){ for(int i = 0; i …

Member Avatar for hfx642
0
309
Member Avatar for 3FatCats

The assignment requires program to read from a file into an array, use two boolean functions to validate certain data (set to "true" when there are no errors) then output any errors to a separate file. Everything works fine except for validating the rate. All the numbers are read into …

Member Avatar for 3FatCats
0
241
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 mistersalty

Hi this is my first post, but I've lurked for a while usually finding answers to my questions in other threads, I couldn't find this one so I broke my posting cherry to ask. I know I'm missing something, probably really simple, but possibly I'm doing this completely wrong. I'm …

Member Avatar for jee08
0
166
Member Avatar for cadence441

For some people it may be difficult to understand what Boolean is.Well, it's a type of algebra. We will be learning about three Boolean operators today-AND,OR,NOT The order for evaluating Boolean operators are as follows:- AND-If you have a code that should be executed if two conditions are true, you …

Member Avatar for mike_2000_17
0
171
Member Avatar for fragtech

My program generates a list of random or pseudo random numbers between a certain range specified by the user through the console. My problem is when the user, or in this case myself, tries to generate a random number list specified by entering true(1) in the console the output is …

Member Avatar for WaltP
0
172
Member Avatar for desert564

the following program is to print all possible sum combinations of a number for example 6=1+5,2+4,3+3,1+1+4,1+2+3 12=3+9,4+8,5+7,.......,1+1+2+3+5 but i m not getting any output...maybe there's a problem with proper ending of loops pls help[CODE]import java.io.*; public class sumpermutations { public void main()throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int input,i,j,d=0,s=0,num=0,d1=0; …

Member Avatar for NormR1
0
254
Member Avatar for Bead

hello this is my first C++ program my problem is that i cant find out to things frist is that when i rune it and sett the mathe type it is ignored laiter and hit shows alle offe the posbole mathe types ( that i have enterd +,-,/ and * …

Member Avatar for l1nuxuser
0
157
Member Avatar for Venku Tur'Mukan

print "Hello, World!" ;) Hi, everyone, Venku (a.k.a Python Newb) here. I just kind of randomly opened up Python today (I do that a lot), and I decided I would finally ask this: What does the "is" statement do in Python 2.7.1 (if the ver# matters)? I checked out the …

Member Avatar for Venku Tur'Mukan
0
792
Member Avatar for magravis

Hello, So I have a .txt file which is kind of built like: N 1234554321 Joe Jones Y 1234555432 Sarah Clark Y 1234321231 Kirah Williams N 1234212321 John Johnston The output, line by line, as the txt file is, and it works and all, I output "Y" or "N" I …

Member Avatar for VernonDozier
0
138
Member Avatar for djbuclkle

I am currently writing a program in which you input a word and the program then outputs all of the different ways the characters can be moved round into anagrams. I have wrote a way of turning the command line argument into a char array using the toCharArray() now I …

Member Avatar for JamesCherrill
0
168
Member Avatar for gingerfish

i have this code, i need to have [B]for()[/B] inside this boolean method, but it shows an error that return method is missing. how can i solve it? [CODE] public static boolean findPrevious(int dataIdx, int featIdx, String data, String[][] array){ for(int i=0; i<dataIdx; i++) { if(array[i][featIdx] == data) return false; …

Member Avatar for Ezzaral
0
185
Member Avatar for stan2000

I'm trying to write a method that draws a rectangle. If the user enters height = 4, and width = 8, and the print of character " * ", then the left rectangle is drawn on the left if the filled flag is true. If the flag is false, then …

Member Avatar for richieking
0
2K
Member Avatar for beejay321

The problem for my CMPT103 class is to write a program that takes a binary number as an integer and returns it as a decimal, i would be able to do this easily by taking it as a charecter array and dealing with each individual element but i dont understand …

Member Avatar for WaltP
0
420
Member Avatar for gavriela

Hi, I'm a student of Java, and my first homework assignment is more advanced than our reading. So...I'm lost. This question is: Q5: Write a program that reads a list of exam scores from the keyboard. Using A=90 to 100, B=80 to 89, C=70 to 79, D=60 to 69 and …

Member Avatar for Er. Mukesh
0
1K
Member Avatar for gavriela

Hello, I'm a student working on my first hands-on assignment. One of the questions is this: Q4: Write a program that converts a user input temperature from degree Celsius to Fahrenheit or Fahrenheit to Celsius using: C = 5 (F -32)/9 or F = 9C/5 + 32 The user must …

Member Avatar for ~s.o.s~
0
407
Member Avatar for dadaqt

3. Consider the Boolean expression F(A,B,C) = ABC + A'C' + A'B'. (a) Using the laws of Boolean algebra, derive an expression that uses only AND and NOT operators. (b) Using the laws of Boolean algebra, derive an expression that uses only OR and NOT operators. First, I am sorry …

Member Avatar for gooradog
0
200
Member Avatar for speedy94519

Hello, I have a question about the code below [CODE] // Checks the vertex a if (this.a != ((Triangle)o).a) { return false; } [/CODE] So In a method called Triangle i declared an instance variable like this: [CODE] private java.awt.Point a [/CODE] What I think this code is doing is …

Member Avatar for jon.kiparsky
0
149
Member Avatar for Gsterminator

so i'm created a program that display the name and grade of students from a file, and also a boolean that checks to see if the names are in alphabetical order. The problem is that i've created a files that has a name in alphabetical order but it still returns …

Member Avatar for Gsterminator
0
141
Member Avatar for hzp

[B]Edit: that was my mistake. i placed the codes in wrong line. i solved it by myself already. thanks for viewing.[/B]

Member Avatar for jonsca
0
132
Member Avatar for techie1991

The last time I was making a program, I wanted to input from user a boolean answer (to save space ;)) An input of 0/1 works good (0-false) and (1-true), but if the user inputs the boolean values as "true" and "false", it comes out to be an error. So, …

Member Avatar for techie1991
0
228
Member Avatar for vikas.kethineed

I have this method to see whether not the year is a leap year or not. heres the code i get the error missing return statement at the end. What can i do , i can't add return true or return false, becuase that screws it up. public boolean isLeapYear() …

Member Avatar for kramerd
0
225
Member Avatar for rinjin07

YO, I would be EXTREMELY grateful if someone can help me out with some boolean method stuff. I have this assignment where we've been building up this bank account project thing, and at the moment I've been asked to put in a boolean method called inBalance that returns true if …

Member Avatar for rinjin07
0
189

The End.