25 Topics
|
|
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, … |
|
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 … |
|
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 … |
|
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); … |
|
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 … |
|
|
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 … |
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 << … |
|
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) … |
|
**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 … |
|
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 … |
|
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 … |
|
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! … |
|
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 … |
|
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] |
|
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 … |
|
[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 … |
|
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 … |
|
|
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] |
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 … |
|
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 |
|
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 … |
|
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 … |
|
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 = … |
|
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, … |
The End.