25 Topics

Member Avatar for
Member Avatar for DS9596

Max and min come out wrong, they go to 0's when it outputs ? How do I fix, any solutions?? #include <iostream> #include <iomanip> #include <string> using namespace std; int main() { int x, y, z; int total; float average; //Read data into x, y, z void ReadData(int & x, …

Member Avatar for necrovore
0
1K
Member Avatar for exoruel

Good Day guys, I wanted to make a multiplication table but it seems not that easy for a newbie like me. Mind taking your time and see what I am missing in my code? It would be a great help. Here's the code: #include<iostream> #include<conio.h> using namespace std; void initArray(int …

Member Avatar for rubberman
0
1K
Member Avatar for mum.roy.77

edges.txt is used.it is the input adjacency list. 1 3 1 5 2 3 2 6 4 5 5 6 #include<stdio.h> #include<stdlib.h> #include<conio.h> int **adjL; int v,*arr; void dfs(int **adjL) { int j,i=0,temp,dfslabel=1,s=0,k=0,top=0; int stack[v]; int *flag; flag=(int*)calloc(v+1,sizeof(int)); for(i=0;i<=v;i++) flag[i]=0; stack[++top]=1; flag[1]=3; stack[top]=1; while(1) { if(i==arr[stack[top]-1]) { printf("examination of %d …

Member Avatar for nitin1
0
198
Member Avatar for jason.angeles.75

public class homework8_2 public static void main(String [] args) { Scanner keyboard = new Scanner(System.in); int selections = 0; DecimalFormat formatter = new DecimalFormat("#0.0000"); do { showMenu(); selections = keyboard.nextInt(); System.out.println("please input the amount of meters"); double meters = keyboard.nextDouble(); if (selections == 1) { double kilometers; kilometers = showKilometers(meters); …

Member Avatar for stultuske
0
240
Member Avatar for mattboy64

I'm almost finished coding the last of my C program on stock inventory but in the last two functions (one being my main function and the other a void function) the compiler gives an error stating that there a Parse Issue and that an expected identifier or "(" is missing …

Member Avatar for Adak
0
214
Member Avatar for jyothsnach
Member Avatar for k3na26

Hi, I kind of need help with my homework. I already have a code but it doesn't seem to work. I'm confused about the parameters I put. I don't know which part I actually messed up. I don't know what else to do. Thank you so much in advance for …

Member Avatar for satabios
0
3K
Member Avatar for aaal

Hello, main.cpp #include <iostream> #include <string> #include <sstream> #include <cstdlib> #include "Triangle.h" using namespace std; int main() { Triangle myTriangle; int side1; double side2; double side3; string input; char ch; do { cout << "Triangle ADT Program" << endl; cout << "Enter the side lengths :" << endl; cout << …

Member Avatar for aaal
0
189
Member Avatar for sofien.fkih

Hi, I am trying to read a value which is in a class (in a public void) in anothe class and I couldn't do that, so please can someone reply me and tell me how to do that using these code. public class CDB { public static String main(String[] args) …

Member Avatar for JamesCherrill
0
388
Member Avatar for gosensgo87

**Hello i am a noob when it comes to java so sorry if its obvious but the code below is giving me a error when i try to compile it, the error is: Exception in thread "main" java.lang.Error: Unresolved compilation problem: at goodcalculator.main(goodcalculator.java:127). Can anyone help me? ** CODE: import …

Member Avatar for JamesCherrill
0
302
Member Avatar for ASFtlink

This program ask user which arithmetic operation they want to play with then generates a random equation and lets the user answer it. When the user stop playing the game the program calculates the number of correct and answers and wrong answers. I need some help because the program crashes …

Member Avatar for Lucaci Andrew
0
302
Member Avatar for shotgun2011

Hi everyone! This is the code that I have written in order to print a tic-tac-toe board. For example, if input was this: 1 2 0 1 1 2 0 2 0 The board would be this: X . O X X . O . O However, I don't know …

Member Avatar for Dani
0
143
Member Avatar for coolbits

I want to create a struct array and get the max number of books written by particular author...The problem is that i can't get the number. I am not finished up yet with the code,but i don't know why i am not getting anything when calling the Max function.Please advise! …

Member Avatar for coolbits
0
144
Member Avatar for jot121

here is the details I got: 1. Create a class called 'GuessMyNumber'. The constructor should chose a random number between 1 and 100. There should be a method 'guess(int guess)' that returns -1 if the guess is too low, 0 if the guess is correct, and 1 if the guess …

Member Avatar for NormR1
0
213
Member Avatar for the_kitoper

Why is this? [CODE] int kitty(GtkWidget* widget, float* foo) { if(*foo != .5f) std::cout << "this usually occurs" << std::endl; } int otherFunc(void) { float foo = .5f; //assume widget has been created g_signal_connect(G_OBJECT(widget), "clicked", G_CALLBACK(kitty), (gpointer)&foo); }[/CODE]

Member Avatar for vijayan121
0
194
Member Avatar for jmcparlin1

I'm new to C++, and I've been picking it up really well, but when it came to making my own function, I hit a problem. I've looked and I cant find the problem, its probably something really stupid but I cant find it. Heres the code, its really simple. I'll …

Member Avatar for adityatandon
0
159
Member Avatar for Matth963

[CODE]import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; import java.util.GregorianCalendar; public class CheckIn{ Date today; void getArrivalDate() { DateFormat df = new SimpleDateFormat("dd/MM/yyyy"); try { System.out.print("Enter Date in dd/mm/yyyy format: "); String d = Keyboard.readString(); today = df.parse(d); df.format(today); } catch (ParseException e) { e.printStackTrace(); } } void …

Member Avatar for NormR1
0
131
Member Avatar for MeandJava

Hello everybody I have a problem with my code. On two lines (14 & 17) I get this error: cannot return a value from method whose result type is void. But I don't have add void to my class. Thanks in advance. Greets MeandJava Here's my code: [CODE]package oop_po2; import …

Member Avatar for MeandJava
0
2K
Member Avatar for Gsterminator

How do i call back a variable in void method into the main method?? [CODE]public void multiply (int x) { Vector3 v3 = new Vector3(num1*x,num2*x,num3*x); }[/CODE]

Member Avatar for Gsterminator
0
167
Member Avatar for epicasian

Well, I've been Googling for at least 30 minutes, and looking through past posts about this, but just can't seem to find an answer that works. Basically, I've got a component class that has a single method I'm trying to test out. The entity class has a private array of …

Member Avatar for epicasian
0
214
Member Avatar for tookerello22

hi how is it possible to return an array from this: private void btnResult_Click(object sender, EventArgs e) { ArrayList arlist = new ArrayList(); arlist.Add(examResults); return arlist; } Many Thanks

Member Avatar for Geekitygeek
0
231
Member Avatar for aukeebler

For a function protoype header can one be double while the other one is void? I'm trying to make the void displayPayment function work, but am a little lost. Should I turn the carPrice, Rebate, ect.. into void functions in the prototype, or can they work without doing that? Thanks …

Member Avatar for WolfPack
0
189
Member Avatar for novellino

I am trying to make a form using html and JSP, get the data and save them in an XML file. I use also Tomcat 1.6 as server. For generating the XML I am using the XStream library. I have a Customer.java class with get and set methods for a …

Member Avatar for novellino
0
466
Member Avatar for Skeen

Okay, I'm making a shooter game, and all my weapons are differnt userdefined objects; ie. the flamethrower works differently then the gun, however, I'm calling some functions in my "main", an example of this would be; [CODE] /* <Init> */ MachineGunClass *CurrentWeapon; MachineGunClass *MachineGun; MachineGun = new MachineGunClass(); CurrentWeapon = …

Member Avatar for mrnutty
0
221
Member Avatar for mymyzzz

I need to finish this program, but i have no idea how to! please help me figure this out. [code] #include <iostream> #include <fstream> using namespace std; void printShips(char [15][15]); void fire(int row, int col, char ocean[15][15], char &result, char &ship); struct counter { int B, C, D, F, T, …

Member Avatar for Clinton Portis
0
392

The End.