tksrules -3 Newbie Poster

How to move pointer in display to beginning of line.I don't want to create a new line.I want to take the cursor/pointer to the beginning in same line.

I have taken help of all possible combinations of System.out.print statements.

For example in the code below i want to print 70 spaces then print any character say "$",then take cursor back to beginning of the same line print 50 spaces and display another character say "#".

I have tried this one with several other combinations:-

class Test
{
  public static void main( String args[] )
  {
     for(int j=0;j<70;j++)
      {
        System.out.print(" ");
      }
      System.out.print("$"); 
      
     for(int j=0;j<50;j++)
     {
        System.out.print("\b");
     }
      System.out.print("$"); 
    
    
    }
}
tksrules -3 Newbie Poster

Ok i will google this thing.I am not very good at handling files except from performing basics like reading writing and appending to text or binary files.

Thanks for this help.It would be great if you can go through thse answers too

Which reference could mean: - Follow the pointer in stemp to a structure. - Select the component named nums (this component is an array). - Reference element 4 of the array.
A) stemp.nums[4]
B) *stemp.nums[4]
C) (*stemp).nums[4]
D) *(stemp.nums)[4]
E) none of the above
typedef struct
{
char name[20];
int id;
double salary;
} emprec_t;
. . .
emprec_t emp1, emp2;
char ch1;
int flag1, flag2;

To call a user-defined function emp_change passing emp1 as an output argument, one would write:
A) emp_change(emp1);
B) emp_change(*emp1);
C) emp1 = emp_change();
D) emp_change(&emp1);
E) none of the above

Just tell me like i dont think you have answered the following answers correctly and i will rethink my answers.Thats all the help i need.If you add some explanation also that would be of great appreciation too.

tksrules -3 Newbie Poster

Thanks i knew something was fishy....But can you tell me what exactly is the pipeflow thing.I have the question and it is neither declared as a variable type or anything.What is it?

tksrules -3 Newbie Poster

Ok guys these three questions doubts.Rest i am sure i am correct.ANswers in red,
typedef struct
{
char name[20];
int id;
double salary;
} emprec_t;
. . .
emprec_t emp1, emp2;
char ch1;
int flag1, flag2;

Given this prototype of a user-defined function emp_nine,

void emp_nine(int num, emprec_t *employp)

How would you assign the value of num to the id component of the function's output parameter?
A) employp.id = num;
B) *employp.id = num;
C) &employp.id = num;
D) employp→id = num;
E) none of the above


The value of the expression cout << pipeflow is _____.
A) cout
B) pipeflow
C) true if output is successful, false otherwise
D) the number of characters output

If bin_inp is a pointer to an open binary input file and list is a 100-element array of type double, what single statement will copy up to 100 values from the file into the array and will save in list_size the number of values copied?
A) list_size = fscanf(bin_inp, "100%lf", list);
B) fread(&list, &list_size, sizeof (double), 100, bin_inp);
C) fscanf(bin_inp, "%lf", &list, &list_size, 100);
D) list_size = fread(list, sizeof (double), 100, bin_inp);
E) none of the above

tksrules -3 Newbie Poster

Start with declaring a 2 dimensional array.

int arr[x][y];

X and y may be input by user or may be fixed to a very high value.Your choice.
Now just Input the values to store in this array as you do normally using a loop...

for(int i=0;i<x;i++)
for(int j=0;j<y;j++)

//input your values...

ALso let us know how much work have you done...

tksrules -3 Newbie Poster

I have answered few multiple choice questions.I am sure i have answered almost 95% correctly.

Maybe you guys can identify if i have committed any mistakes.Just identify not solve.I will solve them myself.Just a hint what is wrong would help as i want to be sure all answers are perfect.

Below is the download link for questions.I have uploaded them to a word file because i thought posting those questions here would make this place clumsy..
Download link:-
http://rapidshare.com/files/234624786/CMCQ.doc.html

Hope you guys can help me correct my mistakes..

tksrules -3 Newbie Poster

Hi,
Just was experimenting a new language.Yes i goggled got through some tutorials and finally compiled the program successfully of my own.

Anyway thank you all for your replies.

tksrules -3 Newbie Poster

In python how to write a simple while loop?I am a C++ expert but i am starting to learn python.

Lets say i need to write a while loop asking the user if he wants to input a number and if the user says yes, the program will input the number and display it..

tksrules -3 Newbie Poster

Hi,
I have completed a C++ application.It is about 3.5 mb in size.

I need to create a demo version of this application,The application should not work after 30 days of installing and using it..

Is there something any software that allows you to create demo versions or what steps should i need to follow.(add codes,etc?)

any books,online materials that is available and i need to follow as an reference??

tksrules -3 Newbie Poster

Removing defreference operator doesnot help.Same error of
structure required on left side of .or . in function addtobook()

tksrules -3 Newbie Poster

Hi,
I have written the following code.I need to convert it to GUI.

import java.awt.*; 
import java.applet.*; 
import java.awt.event.*; 

public class CompString{
    public static void main(String[] args) {
        System.out.println("Enter two strings:");
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        System.out.println("Please enter first string:");
        String str1 = bf.readLine();
        System.out.println("Please enter second string:");
        String str2 = bf.readLine();
        if (string2.compareTo(string1) > 0)
                 System.out.println(str2 + " is greater than " + str1);
        else
            System.out.println(str1 + " is greater than " + str2);


    }
}
tksrules -3 Newbie Poster

Hi,
I am comfortable in c.But i find errors here in my code.I know its related to that structures cant be accessed outside main().Need s use of pointer.How to do?.Help me soon.
A revised code will be of help.

#include <stdio.h>
#include <string.h>
struct phonebook
{ 
char name[100]; 
long int phone; 
}myphonebook[5];
int addtobook(void);
int printbook(void);
int i;
int main()
{
addtobook();
printbook();
return 1;
}
int addtobook()
{
for(i=0;i<5;i++)
{
printf("\n Enter name of friend:-\n");
scanf("%s",&myphonebook.name );
printf("\n Enter phone number of friend:-\n");
scanf("%ld",&myphonebook.phone );
}
return 1;
}
int printbook()
{
for(i=0;i<5;i++)
{
printf("\n Friend name %s phone number is %ld \n",myphonebook.name,myphonebook.phone);
}
return 1;
}
tksrules -3 Newbie Poster

I am on a Mac OSX 10.5.4 with an Airport Extreme Base Station. I have a Dell PC that used to function with the network just fine until the DSL line failed this week. When I tried to get the Dell to connect to my Network, it will not. I tried to reset the WEP Key to match the Apple but it is not working. How can I get the PC to connect to the Airport? Thanks in advance!


Already Tried:
1. I have tried the obvious of turning all the networking equipment off, and then back on. Initially the PC will see my network "Deborah's network", then it falls off and won't reconnect.

2. I went into the network settings on the PC and chose my network from "Available Networks"
Then I chose "Access point [infrastructure] networks only
For encryption I chose "WEP'
Authentication mode "Shared Key" and said "ok"

My PC continues to drop "Deborah's Network" and reconnect to an unencrypted network far away from me. Then I drop off the internet. This happens consistently. Something is wrong.
FYI--my PC has been cleaned of viruses, has a new Virus Protection software [MacAfee], new memory [2 gigs] and a new battery. Should be working well. It's a Dell XPS M140.

The Mac is working great with the network. No problems there.
Thanks in advance.
Deborah

tksrules -3 Newbie Poster

I di what you said.The first line itself in main gives linking error.Also i changed the subclass to return double.

tksrules -3 Newbie Poster

I asked someone to compile to have a better idea.

tksrules -3 Newbie Poster

I did compile by parts but i can't just get going with the CalCost() function.I think i am commiting mistake there.

tksrules -3 Newbie Poster

The question is (Package Inheritance Hierarchy) Package-delivery services, such as FedEx®, DHL® and UPS®, offer a number of different shipping options, each with specific costs associated. Create an inheritance hierarchy to represent various types of packages. Use Package as the base class of the hierarchy, then include classes TwoDayPackage and OvernightPackage that derive from Package. Base class Package should include data members representing the name, address, city, state and ZIP code for both the sender and the recipient of the package, in addition to data members that store the weight (in ounces) and cost per ounce to ship the package. Package's constructor should initialize these data members. Ensure that the weight and cost per ounce contain positive values. Package should provide a public member function calculateCost that returns a double indicating the cost associated with shipping the package. Package's calculateCost function should determine the cost by multiplying the weight by the cost per ounce. Derived class TwoDayPackage should inherit the functionality of base class Package, but also include a data member that represents a flat fee that the shipping company charges for two-day-delivery service. TwoDayPackage's constructor should receive a value to initialize this data member. TwoDayPackage should redefine member function calculateCost so that it computes the shipping cost by adding the flat fee to the weight-based cost calculated by base class Package's calculateCost function. Class OvernightPackage should inherit directly from class Package and contain an additional data member representing an additional fee per ounce charged for overnight-delivery service. OvernightPackage should …

tksrules -3 Newbie Poster

Hi,
Think there's a problem with var[] array.mention details

tksrules -3 Newbie Poster

I need to design tabs shown in the attached document. I designed some but need your help with the rest. Could you create them using 'Pools Tab' code as a blueprint so the programming outline in all the tabs look similar if at all possible? Password for the document is 'J@V@'. Please let me know if you require any additional information or cannot open the document.
'Pools Tab' code -

import java.text.*;

import javax.swing.*;

import java.awt.event.*;

import java.awt.Container;

import java.awt.*;

public class Pools extends JPanel

{

//private JFrame mainFrame;

private JButton calculateButton;

private JButton exitButton;

private JTextField lengthField;

private JTextField widthField;

private JTextField depthField;

private JTextField volumeField;

private JLabel lengthLabel;

private JLabel widthLabel;

private JLabel depthLabel;

private JLabel volumeLabel;

public Pools()

{

//mainFrame = new JFrame("Pools");

calculateButton = new JButton("Calculate Volume");

exitButton = new JButton("Exit");

lengthLabel = new JLabel("Enter the pool's length (ft):");

widthLabel = new JLabel(" Enter the pool's width (ft):");

depthLabel = new JLabel("Enter the pool's depth (ft):");

volumeLabel = new JLabel("The pool's volume is (ft^3):");

lengthField = new JTextField(5);

widthField = new JTextField(5);

depthField = new JTextField(5);

volumeField = new JTextField(5);

//Container c = this.getContentPane();

//this.setLayout(new GridLayout(5,2));

this.setLayout(new FlowLayout());

this.add(lengthLabel);

this.add(lengthField);

this.add(widthLabel);

this.add(widthField);

this.add(depthLabel);

this.add(depthField);

this.add(calculateButton);

this.add(exitButton);

this.add(volumeLabel);

this.add(volumeField);

calculateButton.setMnemonic('C');

Ezzaral commented: No code tags and asking others to complete your work. -3
tksrules -3 Newbie Poster

How do I get PHP to re compile. After I change a file, c:\xampp\phpmyadmin\config.inc.php in editor PSPad and save it, nothing changes, even if stop then start Apache and MySQL in XAMPP window, or reboot. Cannot get phpMyAdmin login to work probably because file changes don't result in application changes.

Optional Information:
OS: Windows XP; Browser: IE

Already Tried:
PSPad button 2nd from top right end
^ F9 - PSPad suggestion
But when change eg user from say Fred to Phil, continues to show Fred thru many changes to the config.inc.php file. But other times it changes!!!!

tksrules -3 Newbie Poster

Hello Java Programming experts. I need assistance with the following excercise: You have been hired as a Java programmer by Real Estates Solutions Inc. Your task is to write a Java applet for their web site that would enable customers to figure out their monthly mortgage payments.

The applet input will be the loan amount, annual percentage rate or APR, and the number of years to pay out the loan. The output will be:the monthly payment amount, the number of payments, the total paid including interest, and total interest paid.

The calculations were provided to you by a real estate agent:

p,loan amount or principal
n,number of payments = payments per year * number of years
i,interest per period = apr/payments per year = apr/12
r,monthly payment amount = principal * interest per period / (1-(1+(interest perperiod)/100)^(number of payments-1)^2)
Hint: In Java syntax the monthly payment calculation is:

r=((p*(i/100))/(1-(Math.pow((1+(i/100)),(n*(-1))))));
Details:

Please note that your program should accept three inputs:

The loan amount,
Annual percentage rate or APR, and
The number of years to pay out the loan
And calculate four outputs:

The monthly payment amount,
Number of payments,
The total paid including interest, and
Total interest paid
When coding your applet, remember the following:

Your applet needs to extend the Applet (or JApplet) class. Of course, you need to import the appropriate applet package(s).
Your applet needs to have …