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...
User Profile
Collapse
-
Array Output/Bubble Sort Issue
-
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) -
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 identifierLeave a comment:
-
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.
...Leave a comment:
-
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.Leave a comment:
-
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...Leave a comment:
-
Sorry about posting it in the wrong forum. Here is my table setup:
...Leave a comment:
-
-
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. -
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 ... -
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>
-
Thanks so much that was driving me crazy. You are a life saver!...Leave a comment:
-
I tried changing the precision numbers but it made it just sent things crazy lol.Leave a comment:
-
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()
Leave a comment:
-
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:...Leave a comment:
-
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;
Leave a comment:
-
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....Leave a comment:
-
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
6Leave a comment:
-
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....Leave a comment:
-
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!Leave a comment:
No activity results to display
Show More
Leave a comment: