User Profile

Collapse

Profile Sidebar

Collapse
Villanmac
Villanmac
Last Activity: Jan 29 '08, 09:36 AM
Joined: Nov 14 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Villanmac
    started a topic Using/setting flag for if statement
    in C

    Using/setting flag for if statement

    Okay basically I have built the code using the pseudocode given to me but i still have on psedocode to mark off and I dont know how to do what it says.

    Its says "a flag is just an integer whose value is either true (1) or false(0). So create an int and set it to false before the inner loop starts, then if a swap is made set it to true. After the inner loop finishes check the value of that int and if it is true then break out of...
    See more | Go to post
    Last edited by sicarie; Jan 28 '08, 06:20 PM. Reason: AAAAAAAARRRRRGGGGGGGGHHHHHHHHH!!!!! READ THE POSTING GUIDELINES. THAT'S WHY THEY'RE THERE!

  • Villanmac
    started a topic Help with this program
    in C

    Help with this program

    Hi, i have been trying to do the following problem for homework, ialthough i have been able to input some code using the psuedocode given to me im am completely stuck now, and i was wondering if anyone could show me what i am missing?

    Question

    Use a single-subscripted array to solve the following problem. A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their...
    See more | Go to post

  • wait (unsigned int delay) and wait (unsigned long delay)

    Hi

    Whats the difference between the two, i forgot to test this out, basically its part of a delay for seven segemtn display which just cycles through numbers, what would be the difference between the two?

    thanks for nay help
    See more | Go to post

  • Villanmac
    started a topic How to represent the £ sign in C++
    in C

    How to represent the £ sign in C++

    Hi

    Im using microsoft visual studio and everytime I try to use the pound sign, when i run the program I get a funny u with a line above it

    What am I doing wrong?
    See more | Go to post

  • Villanmac
    replied to Trouble with the While Statement
    in C
    Cheers mohammad, that was what I was struggling with. Thanks again

    I'd never come across the while(1) statement, so hadnt a chance...
    See more | Go to post

    Leave a comment:


  • Villanmac
    replied to Trouble with the While Statement
    in C
    Thanks, but the problem I then have is when I click -1, the program does not terminate but still asks me the hourly rate of the worker and then works out his/her wage. When the user clicks -1 I want the program to terminate straight away but I cant do it....
    See more | Go to post

    Leave a comment:


  • Villanmac
    started a topic Trouble with the While Statement
    in C

    Trouble with the While Statement

    First up thanks to the guys who pointed out my error last week.

    Now I was wondering If I could get some help with this problem because again I have fallen into trouble. Basically im using the while statement to loop a program but dont know how to loop back to the request of Enter hours worked or (-1 to end) : 39. I cant put it in the while statement as it contains the condition that activates the while statement, if you see what I...
    See more | Go to post
    Last edited by sicarie; Nov 27 '07, 02:54 PM. Reason: Code tags (and excess use of bolding annoys the crap outta me)

  • Villanmac
    replied to Help trying to find prime numbers
    in C
    Hi thanks for replying

    Basically my output says

    the prime numbers from 1 to 10000 are :

    There were 0 prime numbers

    It dosent output anything...
    See more | Go to post

    Leave a comment:


  • Villanmac
    started a topic Help trying to find prime numbers
    in C

    Help trying to find prime numbers

    Hi i have made the following program to make a fucntion that determines if a number is prime. Than i am supposed to use this function to print all prime numbers between 1 and 10000.

    What am I doing wrong as mine dosnt work.

    Thank for any help


    -------------------------------------------------

    [CODE=cpp]#include <iostream>

    using std :: cout;
    using std ::...
    See more | Go to post
    Last edited by Ganon11; Nov 23 '07, 06:38 PM. Reason: Please use the [CODE] tags provided.

  • Thanks guys.

    Ive replaced int pi with - cons float pi = 3.141593

    And replaced my int with double ( Ive always used int and so it occur to me to do that for this). Its nailed on now, giving me the correct results to a greater degree of accuracy.

    Thanks again.
    See more | Go to post

    Leave a comment:


  • Im kinda cracking it I think.

    I get 8 for my diameter which is spot on.

    So it looks like the problem crops up with the circumference and area (so it looks like pi is the problem which makes sense as its the first time Ive used it on a program).

    Now I get

    When radius = 4
    Diameter = 8
    Circumference = -1717986972
    Area = - 858993 or something like that

    ...
    See more | Go to post

    Leave a comment:


  • Villanmac
    started a topic What am I doing wrong with this simple program?
    in C

    What am I doing wrong with this simple program?

    Ahhhh, ive missed so many lessons this year that i have to try and teach myself c++ from a book and its so hard. Usually I just read this forums to pick things up but its doing my head in trying to work it out, so I thought I would sign up and ask some people who know what they doing.

    Basically im trying to write a program that reads in the radius of a circle and prints its radius, diameter,circum ference and area. It dosent seem that...
    See more | Go to post
    Last edited by Ganon11; Nov 14 '07, 03:33 PM. Reason: Please use the [CODE] tags provided.
No activity results to display
Show More
Working...