User Profile

Collapse

Profile Sidebar

Collapse
Prosdo
Prosdo
Last Activity: Dec 19 '07, 06:33 AM
Joined: Nov 10 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Prosdo
    started a topic Array Output/Bubble Sort Issue
    in C

    Array Output/Bubble Sort Issue

    Hi guys. I have a final program for school and the assignment is to show the top 5 numbers for the Cash 5 lottery over the past few days. I think I have all my loops right.I think I have the output listed correctly but it is duplicating on the output. Like the last time I ran it, it came up with the results:
    12
    12
    12
    12
    20

    I am starting to think the bubble sort is written incorrectly. Any help would...
    See more | Go to post

  • Prosdo
    replied to Primary Key Constraint
    slp5065.vendor table
    Name Null? Type
    VENDOR_NO NOT NULL NUMBER(6)
    VENDOR_NAME VARCHAR2(30)
    VENDOR_ADDRESS VARCHAR2(35)
    VENDOR_ZIP_CODE NOT NULL NUMBER(38)

    slp5065.zipcode table
    Name Null? Type
    ZIP_CODE NOT NULL NUMBER(5)
    ZIP_CITY VARCHAR2(15)
    ZIP_STATE VARCHAR2(2)
    See more | Go to post

    Leave a comment:


  • Prosdo
    replied to Primary Key Constraint
    Thank you for the reply. I tried what you said and I got the following error:

    CONSTRAINT slp5065.vendor. zip_code FOREIGN KEY (vendor_zip_cod e)
    *

    ERROR at line 2:
    ORA-00904: : invalid identifier
    See more | Go to post

    Leave a comment:


  • Prosdo
    replied to Primary Key Constraint
    Sorry very new to Oracle and all. slp5065 is my user name. When we did other projects for the class they were named demo.customer. So for each student we had to just put our userid.tablenam e. slp5065.Zipcode is a table. I guess this is the table structure. If it isn't please let me know and I will try to find out what it is.

    ...
    See more | Go to post

    Leave a comment:


  • Prosdo
    replied to Primary Key Constraint
    Can anyone help? I have to turn it in by midnight est. Which is in 38 minutes. I e-mailed my teacher about this a while ago and he hasn't gotten back to me.
    See more | Go to post

    Leave a comment:


  • Prosdo
    replied to Primary Key Constraint
    I see my dumb error on that one. But I am having a problem with the foreign key. My paper says:

    3. Alter Vendor table to add constraint of Vendor.Zip_Code as a Foreign Key field references Zipcode.Zip_cod e field.

    Code:
    ALTER TABLE tablename ADD
                                  CONSTRAINT fk_name FOREIGN KEY (column_name)
                                  REFERENCES tablename (column_name);


    I...
    See more | Go to post

    Leave a comment:


  • Prosdo
    replied to Primary Key Constraint
    Sorry about posting it in the wrong forum. Here is my table setup:
    ...
    See more | Go to post

    Leave a comment:


  • Prosdo
    replied to Double to Int
    in C
    I fixed it with a static cast. Thank you though....
    See more | Go to post

    Leave a comment:


  • Prosdo
    started a topic Double to Int
    in C

    Double to Int

    Hi guys. I e-mailed my teacher about this a couple days ago and he hasn't gotten back to me. If I am dealing with a double and I want to convert it to an int is there a certain command I use? Because I am getting errors.

    The program calls for roofing squares and if it has any decimal points the teacher said round up. He said just turn it to an int and add 1. The problem is I am getting errors. Thank you.
    See more | Go to post

  • Prosdo
    started a topic Primary Key Constraint

    Primary Key Constraint

    Hey guys. This is a school related question. My lab says the following:

    1. Add a new Vendor table
    a. See table above for fields and data types
    b. Use your username as the table definition, i.e., userid.Vendor, instead of Demo
    c. Add Primary key ProductNo as a Constraint

    Okay, I created the table with the fields and data types. Now when I go to add the primary key with the constraint and I get ...
    See more | Go to post

  • Prosdo
    started a topic Weird Error
    in C

    Weird Error

    Okay, I am writing this program for class and it kind of works. It goes through the motions, but would skip the prompt where I ask if they want to add another customer. So, I realized I missed a bracket on an if statement and it brought up this error after I corrected it:


    Here is the code:

    Code:
    #include <iostream.h>
    #include <stdlib.h>
    #include <fstream>
    #include <string>
    ...
    See more | Go to post

  • Prosdo
    replied to Loop Not Working
    in C
    Thanks so much that was driving me crazy. You are a life saver!...
    See more | Go to post

    Leave a comment:


  • Prosdo
    replied to Loop Not Working
    in C
    I tried changing the precision numbers but it made it just sent things crazy lol.
    See more | Go to post

    Leave a comment:


  • Prosdo
    replied to Loop Not Working
    in C
    I can't get it to just show one decimal point for the height. I don't know what I'm doing wrong.
    Code:
    #include <iostream.h>
    #include <stdlib.h>
    #include <cmath>
    #include <iomanip>
    #include <fstream>
    
    using namespace std;
    float const gravity = 9.8;
    float velocity;
    float seconds;
    float height;
    ofstream launch;
    
    int main()
    ...
    See more | Go to post

    Leave a comment:


  • Prosdo
    replied to Loop Not Working
    in C
    c:\docume~1\ste pha~1\desktop\p rogra~1.cpp: In function `int main()':
    c:\docume~1\ste pha~1\desktop\p rogra~1.cpp:22: parse error before `||'
    c:\docume~1\ste pha~1\desktop\p rogra~1.cpp:22: `fixed' undeclared (first use this function)
    c:\docume~1\ste pha~1\desktop\p rogra~1.cpp:22: (Each undeclared identifier is reported only once
    c:\docume~1\ste pha~1\desktop\p rogra~1.cpp:22: for each function it appears in.)
    c:\docume~1\ste pha~1\desktop\p rogra~1.cpp:22:...
    See more | Go to post

    Leave a comment:


  • Prosdo
    replied to Loop Not Working
    in C
    My last problem is the professor said I need to format the output with a fixed, showpoint and setprecision. But I am getting errors. We didn't cover these too much so I am kinda shaky on them.

    Code:
    #include <iostream.h>
    #include <stdlib.h>
    #include <cmath>
    #include <iomanip>
    #include <fstream>
    
    using namespace std;
    float const gravity = 9.8;
    float velocity;
    ...
    See more | Go to post

    Leave a comment:


  • Prosdo
    replied to Loop Not Working
    in C
    Thanks Ganon. I figured it out I added an if statement inside the loop. I appreciate all your help and feedback. It is so appreciated....
    See more | Go to post

    Leave a comment:


  • Prosdo
    replied to Loop Not Working
    in C
    When you run it does it go into the negatives in the results like:
    Time(Seconds) Height(Meters)

    1 20.1
    2 30.4
    3 30.9
    4 21.6
    5 2.5
    6
    ...
    See more | Go to post

    Leave a comment:


  • Prosdo
    replied to Loop Not Working
    in C
    I did that. My professor said to use a while loop so it doesn't go past when the projectile hits the ground. When I do that it doesn't work, but as soon as I make it a for loop it runs except it goes one past when the projectile would hit the ground into the negative and I'll lose points for that....
    See more | Go to post

    Leave a comment:


  • Prosdo
    replied to Loop Not Working
    in C
    Okay I fixed the cin issue kinda. Now it is only writing my headers to the file. I don't get what is going on. Before I fixed the cin issue it was writing data to the output file even though it was wrong. I was suppose to use a while loop but it only works with a for loop and when I use the for loop it put the wrong data. Ugh!
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...