Search:

Type: Posts; User: nadeera

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    23
    Views
    13,564

    Horribly Formatted Code??

    I was wondering if anyone could tell me what is a horribly formatted code and what are "well" formatted codes supposed to look like? What would make someone say the program is horribly formatted?...
  2. Replies
    15
    Views
    3,301

    I have no idea what's wrong with this. It shows...

    I have no idea what's wrong with this. It shows no error when it compiles but when I run it, it goes a little crazy.
    14744


    #include <iostream>#include <string>
    using namespace std;


    struct...
  3. Replies
    15
    Views
    3,301

    It's returning garbage values and I can't figure...

    It's returning garbage values and I can't figure out why. It seems like there is something very simple I missed.


    amountDue = amountDue1 + amountDue2 + amountDue3 + amountDue4;
  4. Replies
    15
    Views
    3,301

    This is basically what I want to do. If I...

    This is basically what I want to do. If I initialize quantity[itemNumber] =0, I get error C2440: 'initializing': cannot convert from 'int' to 'double[8]'.


    const int itemNumber = 8;
    const...
  5. Replies
    15
    Views
    3,301

    Error CC296 and C2297

    I can't figure out how to solve this error, please help.


    double price[itemNumber] = {10.50, 13.00, 10.50, 13.00, 8.50, 10.00, 11.50, 13.50};
    double quantity[itemNumber];
    double amountDue;
    ...
  6. Replies
    13
    Views
    1,172

    This is the code I have written so far. ...

    This is the code I have written so far.


    #include <stdio.h>#include<math.h>
    #define FINAL_EXPECTED 40.0
    #define TOTAL_EXPECTED 100.0


    struct result{
    double final;
  7. Replies
    13
    Views
    1,172

    Okay, got it. What does this error mean and how...

    Okay, got it. What does this error mean and how to avoid it?
  8. Replies
    13
    Views
    1,172

    You used int main(void) instead of what I used...

    You used int main(void) instead of what I used which is main(). When should I use int main() and when to use main()? Except for return 0, I don't see much difference in them. Is it advisable to have...
  9. Replies
    13
    Views
    1,172

    Is that the same with this code? struct...

    Is that the same with this code?


    struct result{
    double final;
    double midterm;
    double labtest;
    double quiz;
    double assignment1;
    double...
  10. Replies
    13
    Views
    1,172

    #include #include struct...

    #include<stdio.h>
    #include<math.h>


    struct result{
    double final;
    double midterm;
    double labtest;
    double quiz;
    double assignment1;
  11. Replies
    13
    Views
    1,172

    Logic for Course Marking Scheme

    I'm going for a second attempt at my project. The system would allow Lecturer to Create a course marking scheme. A course marking scheme allows a lecturer to set the weightage of individual...
  12. Replies
    18
    Views
    33,518

    Oh, ok. So when do you suggest I use the if...

    Oh, ok. So when do you suggest I use the if statement and when not to use it?
  13. Replies
    18
    Views
    33,518

    Okay. Will do.

    Okay. Will do.
  14. Replies
    18
    Views
    33,518

    Improvised version. #include...

    Improvised version.


    #include<stdio.h>
    #define DOLLAR 100
    #define QUARTER 25
    #define DIME 10
    #define NICKEL 5

    main()
  15. Replies
    18
    Views
    33,518

    I tried writing the codes. #include...

    I tried writing the codes.


    #include<stdio.h>

    main()
    {
    int dollars = 0;
    int quarters = 0;
    int dimes = 0;
  16. Replies
    18
    Views
    33,518

    Thank you so much for this post. I finally got my...

    Thank you so much for this post. I finally got my enlightenment! It was definitely very helpful because I got to see the process of writing codes. I have a question, though. I am assuming that we are...
  17. Replies
    18
    Views
    33,518

    This is what I understand. 1. Total cents...

    This is what I understand.

    1. Total cents divide by 100 to get dollars.
    2. The remainder is the cents.
    3. The cents should be divided by 25 to get quarters.
    4. After quarters is removed, the...
  18. Replies
    18
    Views
    33,518

    Noted Hodor. I will. Thanks. I understand how to...

    Noted Hodor. I will. Thanks. I understand how to convert the money into dollars and cents, but after that I have no idea how to break down the cents further into quarters, nickels, etc. That is my...
  19. Replies
    18
    Views
    33,518

    Exercise 3 --- Correct Change

    When cashiers in a store give you change they try first try to "fit" dollars into the amount you get back, then try to "fit" quarters (25 cent coins) into what is left over, they try to "fit" dimes...
  20. Replies
    15
    Views
    1,534

    Nope, I did not get any warnings. I changed it as...

    Nope, I did not get any warnings. I changed it as you said, and now it works perfectly. Thank you so much. :D
  21. Replies
    15
    Views
    1,534

    Okay, but as soon as I convert everything it...

    Okay, but as soon as I convert everything it gives me a completely ridiculous answer. Is there anything I missed? Can you try running it, please?


    #include<stdio.h>#define M_PI...
  22. Replies
    15
    Views
    1,534

    Yes, I am trying to do the exercises from that...

    Yes, I am trying to do the exercises from that website. So I suppose coding this way, will do?


    #include<stdio.h>#define M_PI 3.14159265358979323846


    float square(float x);


    main()
  23. Replies
    15
    Views
    1,534

    I came up with a new code. How do you use the...

    I came up with a new code. How do you use the function pi()? When do I use type double or type float?


    #include<stdio.h>

    float square(float x);


    main()
    {
  24. Replies
    15
    Views
    1,534

    Exercise 1 --- Area of a Circle

    Write a program that calculates the area of a circle from the radius. The radius will be an integer read in from the keyboard. You will need to use the function pi(). According to my understanding,...
  25. Replies
    11
    Views
    4,829

    This is sort of what I came up with for the...

    This is sort of what I came up with for the lecturer's part.


    #include<stdio.h>#include<string.h>
    #include<conio.h>


    struct lecturerData
    {
    char name[50];
Results 1 to 25 of 44
Page 1 of 2 1 2