Hello, I work at the U.S. Department of Labor. I am a maintenance prorgrammer of C code, and the configuration management of this code in the past has been very spotty. When I took over this project, a CM tool was in place I have been doing corret checkins and checkouts, but the problems of the past bad management contiue to cause problems for me. There is a C screen I have been asked to modify to increase the allowed amount of a field. The code for that screen was never checked in to the CM tool, and I found …

Member Avatar
Member Avatar
+1 forum 11

To begin with, I'm a noob to JavaScript. How do I add functionality to the main loop, or something similar?

Member Avatar
Member Avatar
+0 forum 3

Hi! Newbie on Java. I'm doing this assignment for a cash register program. Our professor just explained what we're gonna do and stuff. Here's what i understood: 1.)Sales report (my code appears on the first diag box) Product ID Product Name Quantity Price 2 Stuff 100 3 Stuff 100 4 Stuff 100 5 Stuff 100 2.)Prompt the user to enter product ID and quantity needed. ex: ID: 2 Quantity needed: 5 3.)Present the new sales report. ex: Product ID Product Name Quantity Price 2 Stuff 95 3 Stuff 100 4 Stuff 100 5 Stuff 100 -------------------------------------------------------------------------------------------------------------------- Here's what i've done …

Member Avatar
Member Avatar
+0 forum 5

def main(): print ('Welcome to the mpg calculator program') print() #get the miles driven using the input function miles_driven = input ("Please enter miles driven: ") miles_driven = float (miles_driven) #get the gallons used using the input function gallons_used = input ("Please enter gallons used: ") galons_used = float (gallons_used) #calculate mpg here, using the inputted values mpg = miles_driven / gallons_used print('The MPG based on', format(miles_driven, '.2f'),\ 'miles driven and with', format(gallons_used, '.2f'), \ 'gallons used is:', format(MPG, '.2f'),sep=' ') #calls main main() >>> Welcome to the mpg calculator program Please enter miles driven: 200 Please enter gallons used: …

Member Avatar
Member Avatar
+0 forum 7

How we can right the computer main board?

Member Avatar
Member Avatar
+0 forum 1

Hey Everyone, I want to instantiate an ArrayList in java. I realize the method to doing this is: ArrayList<String> determiners = new ArrayList <String>(); determiners.add("A"); Where "A" is added to the arraylist once created. However, the problem I'm having is that the .add method doesn't work unless in a main method. What is the santax for making it work in a class without the main method. Thanks

Member Avatar
Member Avatar
+0 forum 8

when you write code in the main function if you put functions in the file all you do is nameoffunction(); to call it. now my question is this lets say you have a menu in a class. call it bank. in the main to call that function . ive tried calling it the same way but that wont work because function isnt in main file. i thought that if you declared a class object .. bank account; then account.nameofFunction(); it would call it but it says there is a link error .. how do i call a function holding a …

Member Avatar
Member Avatar
+0 forum 5

Hello.Please anyone help me with this code. I tried to look in every forum but nothing gives the right answer. Promblem is: **R cannot be resolved to a variable** . Here is my java code: package com.example.twittersearch; import java.util.Arrays; import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.TableLayout; import android.widget.TableRow; public class TwitterSearch extends Activity { private SharedPreferences savedSearches; TableLayout queryTableLayout; EditText queryEditText, tagEditText; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); savedSearches = getSharedPreferences("searchData", MODE_PRIVATE); queryTableLayout = (TableLayout)findViewById(R.id.queryTableLayout); queryEditText = (EditText)findViewById(R.id.queryEditText); tagEditText = (EditText)findViewById(R.id.tagEditText); Button saveButton = (Button)findViewById(R.id.saveButton); …

Member Avatar
Member Avatar
+0 forum 1

public static int f (int []a, int []b,int []c) { final int N=a.length; int j, k=0, g=0, t=0 ; for(int i=0;i<N;i++) { for (j=0;j<N;j++) if (b[j]==a[i]) break; if (j==N) { c[t]=a[i]; if (g==0 || c[t]>k) { k=c[t]; g=1; } t++; } } return k;

Member Avatar
Member Avatar
+0 forum 8

Hello, I have been given a class diagram where a variable called light_years must be a const int and stored in the space class, but later on that value must be used in the main file. Below is the space class class space { private: static const int LIGHT_YEARS; public: // -Many functions are here- }; I need to access the value here #include "stdafx.h" #include <iostream> #include "Space.h" int _tmain(int argc, _TCHAR* argv[]) { for (int i=0; i<3; i++) { 8*LIGHT_YEARS; // I've tried 8*Space::LIGHT_YEARS; } system("pause"); return 0; } Is there someway to friend the main function or …

Member Avatar
Member Avatar
+0 forum 3

I have two classes: (1) **Class A**, which extends JApplet, implements Runnable + some Listener stuff (2) **Class B**, which has a main method and is not an applet My question is, how do I create **class A** with **class B**'s main method? Is this even possible? What I'm doing right now (and this may be totally wrong because I'm still an amateur) is the following: public class classB { static classA applet; public static void main(String[] args){ //misc. applet = new classA(); applet.init(); } //misc. } The problem is, the applet isn't showing up. Using some *System.out.println()* lines, I'm …

Member Avatar
Member Avatar
+0 forum 1

Hi! I would just like to know is there a way you can overwrite the main.c file in the kernel folder(dir /usr/src/kernel/main.c) in MINIX 3. I want to change some code in the file(I know the risks involved) but the problem is I can't save it. I've tried logging in as 'bin' and 'root' and still the same issue. Is there another way of doing this? Thanks-and any help will be appreciated! :D

Member Avatar
Member Avatar
+0 forum 2

#include <iostream> #include <string> #include <cmath> using namespace std; //global varibals: char entered_characters[9999]; int direction_of_rotor1; int direction_of_rotor2; char alphabet_of_rotor1[26]; char alphabet_of_rotor2[26]; char rotor1_backward(char Letter); char rotor1_forward(char Letter); char rotor2_backward(char Letter2); char rotor2_forward(char Letter2); char print(char print_char); int main() { cout << "This is enigma machine:" << endl; cout << "*NOTE:This programe accepts only lower case letters" << endl; cout<<"--------------------------------------------------------------"<<endl; cout << "Enter letters for the first rotor:" << endl; cin >> alphabet_of_rotor1; cout<<"--------------------------------------------------------------"<<endl; cout << "Enter letters for the second rotor:" << endl; cin >> alphabet_of_rotor2; cout<<"--------------------------------------------------------------"<<endl; cout << "Chose direction of rotor 1:" << endl; cout << "*(i.e.:enter 1 …

Member Avatar
Member Avatar
+0 forum 2

When i declare array in c before main method it gives, an error. Declaration is char a[65000]; main() {} and another declaration in other file char a[63000]; main() {} has no error what is the reason.

Member Avatar
Member Avatar
+0 forum 7

**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 java.awt.*; import java.awt.event.*; import javax.swing.*; class goodcalculator extends JFrame { JButton add, subtract, multiply, divide; JtextField num1, num2; JLabel result, enter1, enter2; public goodcalculator() { setLayout (new GridBagLayout()); GridBagConstraints c =new GridBagConstraints(); enter1 = new JLabel("1st: "); c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy = 0; add(enter1, c); num1 = …

Member Avatar
Member Avatar
+0 forum 3

Two doubts: 1. Placing run() inside main() generates "illegal start of expression error"? So why can't run() be placed inside main()? 2.With the above code I am getting the output as A C D B. Why B comes last is because of join(). But what I'm unable to understand is that on invoking start() shouldn't run() get called immediately thus generating the output as C D A B? Help please..Thanks

Member Avatar
Member Avatar
-1 forum 2

I'm very new to C++; can a program be started with anything other than `int main`? And what, exactly, is the purpose of the `main` part, anyway?

Member Avatar
Member Avatar
+0 forum 6

Hello I am running into an error after creating the jar file. I get a message stating that the main class to my program could not be found when in fact there is a main class. If someone could give me a hand and lead me in the right direction on how to tackle this problem, it will be greatly appreciated. Thanks. This is my main program file: public class MainProgram{ public static void main(String args[]) { /* * Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* * If Nimbus …

Member Avatar
Member Avatar
+0 forum 24

** Having trouble running this code as the compiler keeps having issues with the method 'public void mannipulate()', I'm new to java so forgive my ignorance, but I've been trying to rearrange everything in every which way to please this thing and its just not turning out right. I'm sure I'm missing something but it's just not apparent at the moment. Help would be much appreciated, thanks!** public static void main(String []args) { public void manipulate() { String fileName = FileChooser.pickAFile(); Picture picObj = new Picture(fileName); picObj.show(); int y = picObj.getHeight(); int x = picObj.getWidth(); double xborder = (x*0.05); double …

Member Avatar
Member Avatar
+0 forum 1

I am trying to create a 2d table that asks for user input to create table size, adds all the numbers across each row, and creates the next row by multiplying by the first row. Here's what I have and it's now giving me an "Exception in thread "main" java.lang.NullPointerException" error. Any help is greatly appreciated! public static void main(String[] args) { Scanner input = new Scanner (System.in); int[][] table = new int [11][]; int[] row = new int[0]; System.out.println("Enter integer to create table size: "); int numRows = input.nextInt(); for (int i=0; i<table.length; i++){ for (int j=0; j<table[i].length; j++) …

Member Avatar
Member Avatar
+0 forum 18

So i have a jar of a project that i was working on, and i want to use it as a library in another project (resource adapter). I have brought it into the libraries folder, and used an import. I basically want to be able to call that whole project in thar jar from main. Then from main there is one of two functions i want to call. How can i do this? Thanks

Member Avatar
Member Avatar
+0 forum 3

To make it short and sweet, here it is. Looking to do a simple screenshot on the client-side (and if anyone would be so kind, point me in the direction to create an automated upload of the screen to a server. ++ if you can provide a tip on doing this at an interval).. import java.awt.AWTException; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; public class ScreenShot { /** method to capture screen shot @param String uploadPath to save screen shot as image @returns boolean true if capture successful else false */ boolean captureScreenShot(String …

Member Avatar
Member Avatar
+0 forum 14

I am trying to parse main(argc, argv[]); and i need to look at individual characters with in the strings pointed to by *argv[]. I though of a string as an array of chars. This builds fine but causes an error in execution. So what is a simple and straight forward way. Lets say I want to look at each character in a string pointed to by argv[c] and/or compare the each character or compare strings. I am sure this is quite simple and I want to keep it simple if possible. I am missing something here. Thanks in advance for …

Member Avatar
Member Avatar
+0 forum 4

Hello there java gang. I've written a program which basically checks the dates that i have written for the program in question and then validates it against a set of rules, using arrays to ensure that what a user enters is valid. So for example, you can have 1,(day) 5,(month), 2009(year). And this will be validated correctly, for it is within the parameters. I'm having two problems, one is, how do i allow a user to enter a date and store it in the place i have written my other dates, USING the void main parameter entry form, (not a …

Member Avatar
Member Avatar
+0 forum 8

is this a valid statement in in c: &main, where main is int main()? If so why?

Member Avatar
Member Avatar
+0 forum 3

Im having a main function issue. My program is a text analyzer of more than several lines and then input 'END' to stop taking input. It analyzes input text based on the chosen options 1 through 2, relooping for invalid choice. Im having an issue having it properly work in the main function. Here is what I have: [CODE]def input(): line = "" twodimensional = [] while line != "END": line = raw_input("") if (line != "END"): new_line = "" for char in line: if char.isalpha(): new_line += char else: new_line += " " line_list = new_line.split() twodimensional.append(line_list) return twodimensional …

Member Avatar
Member Avatar
+0 forum 1

I am making a program that analyzes text from a user After inputting several line and using the keyword "DONE", the program will ask for one of 8 possible options which is the menu() function where the user will enter the number. How would i be able to run my program using main() function to where the user will be able to enter a choice have the text analyzed according to my functions and then be prompted again until they choose to quit the program. Also a choice of numbers under 1 or greater than 8 must not work for …

Member Avatar
Member Avatar
+0 forum 1

So from what I've been taught, in school and in books, all C programs(I assume C++ too) always have main(). That's very explicitly mentioned. However in my poking around with some relatively large open source projects in hopes of learning something, it isn't as straight forward. What I've encountered was that there were a lot of C files that only contained function definitions, as if being used as header files(which was confusing too since they weren't called via include. How they kind of go together escapes me). I found it weird because it seems that they were all connected, really …

Member Avatar
Member Avatar
+0 forum 11

i want to make a program that contains two main classes and they call each other. [CODE]class Main1 { public static void main(String arg[]) { for(int i=0;i<5;i++) System.out.println(i); Main2 m1=new Main2(); } } class Main2 { public static void main(String arg[]) { static int j=0; for(int i=0;i<5;i++) System.out.println(i); if(j==3) break; j++; Main1 m1=new Main2(); } }[/CODE] it is the code that i implemented. i use static variable so that i can control the no of calls but this shows an error when i use static variable. please solve it for me..

Member Avatar
Member Avatar
+0 forum 4

[B]For the error and my question, skip to the bottom. I just posted all of the code in case it's needed.[/B] [CODE]/*********************************************************************************** * * File: Customer.java * * Author: Austin Smith * * Date: 04/04/2011 * * Description: The Customer class handles all client information * such as name and address. * **********************************************************************************/ public class Customer { /*** Defaults/Constants ***/ public static final String DEFAULT_NAME = "ERROR: Invalid Name"; public static final String DEFAULT_ADDRESS = "ERROR: Invalid Address"; public static final String DEFAULT_CITY = "ERROR: Invalid City"; public static final String DEFAULT_STATE = "ER"; public static final String DEFAULT_ZIP_CODE = …

Member Avatar
Member Avatar
+0 forum 3

The End.