Jump to content

Lights Out

Members
  • Posts

    6
  • Joined

  • Last visited

Lights Out's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Lights Out

    Wrapper

    My text is leaking out of my divs. I have a two-column layout going inside of a div, and the content inside my left column is leaking out over top of my column to the right of it. I can't figure out how to wrap the text inside of my div.XHTML <body><div id="container"> <div id="banner"> <h1>Cosby High School</h1> </div> <div id="nav"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Events</a></li> <li><a href="#">Officers</a></li> <li><a href="#">Pictures</a></li> <li><a href="#">Links</a></li> </ul> </div> <div id="content"> <div id="events"> <h1>January 22</h1> <p>this text is covering up my meetings div...leaking off to the right side</p> </div> <!-- <div id="clearfix"></div> --> <div id="meetings"> <h1>January 19</h1> <p>this text is leaking out of the right hand side of my meetings div..off of the screen</p> </div> </div> </div> CSS body { font:1em verdana, arial, sans-serif; text-align:center;}* { margin:0; padding:0; }div#container { margin:10px auto; width:600px; border:1px solid gray; text-align:left;}div#banner { width:100%; height:100px; background: #000000 repeat; color:#0099FF;}div#nav { width:100%; float:left; border-top:1px solid #069; border-bottom:1px solid #069; font-size:.8em; background-color:#8BC5DD;}div#nav ul { margin:0 0 0 30px;}div#nav li { float:left; list-style-type:none; padding:0 6px;}div#nav a { text-decoration:none; color:#000000;}div#nav a:hover { color:white;}div#content { font-size: .8em; height:100%; border:1px dotted red; margin:10px;}p { margin:10px; padding:5px;}#events,#meetings { width:250px;}#events { background-color:blue; float:left;}#meetings { background-color:orange; margin-left:270px;} Is there something I can do to make the text wrap?
  2. haha sorry. it is just a lot to read.
  3. Lights Out

    my code

    #include <iostream.h>#include <fstream.h>#include <string.h>void results(int num); //prototype results()int lookup(void); //prototype lookup()struct element_info { float mass; //atomic mass int num; //atomic number char symbol[3]; //element symbol char name[20]; //element name} elements[6];int main(){ char *filename = "Elements.txt"; //file used for input int i; //counter in while loop ifstream infile; //file handle infile.open(filename, ios::in); //open file i = 1; while (!infile.eof()) { infile >> elements[i].mass; //get element atomic mass infile >> elements[i].num; //get element atomic number infile >> elements[i].symbol; //get element chemical symbol infile >> elements[i].name; //get element name i += 1; } //while loop continues until EOF is reached results(lookup()); //show the results depending on lookup()'s return value return 0;}int lookup(){ int i; //counter in loops int num = 0; //used to display correct element group int type; //type of search //user input float atom_num; //atomic number char sym[5]; //symbol char name[20]; //name cout << "What type of search would you like to do?" << endl; cout << "Symbol - 1\nName - 2\nAtomic Number - 3" << endl; cin >> type; cout << "Make sure all strings are properly capitalized." << endl; cout << "--------------------------------------------" << endl; switch(type) //just using a switch to make sure i get the right variable *type* { case 1: cout << "Please enter the chemical symbol: "; cin.ignore(80, '\n'); cin.get(sym, 25); break; case 2: cout << "Please enter the element name: "; cin.ignore(80, '\n'); cin.get(name, 25); break; case 3: cout << "Please enter the atomic number: "; cin >> atom_num; break; default: cout << "You did not enter a correct choice." << endl; break; } for(i = 1; i < 6; i++) { if (!strcmp(sym, elements[i].symbol)) { num = i; } else if (!strcmp(name, elements[i].name)) { num = i; } else if (atom_num == elements[i].mass) { num = i; } } return num;}void results(int num){ if(num) { cout << "\nYour search results:" << endl; cout << "---------------------" << endl; cout << "Element Name: \t" << elements[num].name << endl; cout << "Chemical Symbol: \t" << elements[num].symbol << endl; cout << "Atomic Number: \t" << elements[num].num << endl; cout << "Atomic Mass: \t" << elements[num].mass << endl << endl; } else { cout << "Your search string did not match any of our records.\n" << endl; }}
  4. #include <iostream.h>#include <math.h>#include <ctype.h>void cloverHillWelcome(void);void cloverHillDisplay(int x, int y);int moveStudent(int &x, int &y, int &keep_going);void mathClass(void);double findThePower(double x, double y);void scienceClass(void);int mixThemUp(int liquid1, int liquid2);/*void englishClass(void);void famousQuote(char[])void socialStudiesClass(void);void getPopulation(char countryCode, int&x);void talkToAFriend(void);*///prototypingint main(void){ int x, y; int keep_going = 1; x = y = 0; //starting location is (0, 0) cloverHillWelcome(); //welcome the person do { moveStudent(x, y, keep_going); cloverHillDisplay(x, y); } while(keep_going); //cloverHillDisplay(0, 0); return 0;}void cloverHillWelcome(void){ cout << "_ _ _ ____ _ ____ ____ _ _ ____ ___ ____" << endl; cout << "| | | |___ | | | | |\\/| |___ | | |" << endl; cout << "|_|_| |___ |___ |___ |__| | | |___ | |__|" << endl; cout << "\n"; cout << "____ _ ____ _ _ ____ ____ _ _ _ _ _ |" << endl; cout << "| | | | | | |___ |__/ |__| | | | |" << endl; cout << "|___ |___ |__| \\/ |___ | \\ | | | |___ |___ ." << endl; cout << "Directions: \n When prompted for direction to move, press either N, S, E, W, or Q to quit." << endl; cout << "N will move you 1 space up, E for 1 space right, and so on. There will be 4 \nrooms"; cout<< " that you will able to visit -- Math, Science, English, and Social Studies." << endl; char you[] = " O\n\\|/\n{ }\n/-\\"; char fr1end[] = " X\n\\|/\n{ }\n/-\\"; cout << "This is YOU:" << endl; cout << you << ", but you will be displayed as 'O'"; cout << "\n\nThis is YOUR FRIEND:" << endl; cout << fr1end << ", but he/she will be displayed as 'X'" << endl; //display initial hallway where you are @ (0, 0) cout << "\n\n | | | |" << endl; cout << "---------| Math |---------| English |-----------" << endl; cout << "\nO X\n" << endl; cout << "---------| |---------| |-------" << endl; cout << " | Science | | Social Studies |" << endl;}//cloverHillWelcomevoid cloverHillDisplay(int x, int y){ int num_spaces = 0; //number of spaces to put in front of 0, as well as number of //spaces to delete in front of X char backspace = 8; //backspace character char space = 32; //space character // X cout << "\n\n | | | |" << endl; cout << "---------| Math |---------| English |-----------" << endl; cout << "\n"; //determine how many spaces to put in front of O and how many to take away in front of X switch(x) { case 5: num_spaces = 4; break; case 10: num_spaces = 9; break; case 15: num_spaces = 16; break; case 20: num_spaces = 23; break; case 25: num_spaces = 28; break; case 30: num_spaces = 34; break; case 35: num_spaces = 42; break; case 40: num_spaces = 49; break; case 45: num_spaces = 55; break; case 50: num_spaces = 62; default: num_spaces = 0; break; } //OUTPUT for(int i = 1; i <= num_spaces; i++) cout << space; //spaces in front of O cout << "O"; for(int k = 1; k <= 43; k++) cout << space; //original number of spaces in front of X ( 43 ) for(int j = 1; j <= num_spaces; j++) cout << backspace; //remove spaces according to amount of cout << "X\n" << endl; cout << "---------| |---------| |-------" << endl; cout << " | Science | | Social Studies |" << endl;}//cloverHillDisplayint moveStudent(int &x, int &y, int &keep_going){ //return 0 on failure //return 1 on success char direction; cout << "Where would you like to move? "; cin >> direction; direction = toupper(direction); //MOVE THE PERSON switch(direction) { case 'N': y += 5; //move 1 spot right break; case 'S': y -= 5; //move 1 spot left... break; case 'E': x += 5; break; case 'W': x -= 5; break; case 'Q': keep_going = 0; //Q for quit, the do...while terminates iteration in main() return 0; //MOVE WAS UNSUCCESSFUL...QUITTED break; default: cout << "\n<------Not a valid direction.------>\n"; return 0; //NOT A VALID DIRECTION, MOVE WAS UNSUCCESSFUL break; } //TEST IF LOCATION IS POSSIBLE //test if too far left or right ( off the map ) if((x < 0) || (x > 60)) { cout << "You have moved too far down the hall, restart." << endl; x = y = 0; //reset to (0, 0) return 0; } //SEE IF A WALL IS HIT //if the person hits a wall before the math or science room if( ( (y >= 1) || (y <= -1) ) && (x <= 10)) { cout << "You hit a wall. Try again."; x = y = 0; //respawn to closest checkpoint (0, 0) return 0; } //if the person hits a wall after the math/sci rooms and before the english/ss else if( ((y >= 1) || (y <= -1)) && ((x >= 24) && (x <= 34)) ) { cout << "You hit a wall. Try again."; x = 25; y = 0; //respawn to closest checkpoint (25, 0) return 0; } //if the person hits the wall after the english room else if( (y >= 1) && ((x >= 49) && (x <= 60)) ) { cout << "You have hit a wall. Try again."; x = 50; y = 0; //respawn to the closest checkpoint (50, 0) return 0; } //if the person hits the wall after the SS room else if( (y <= -1) && ((x >= 55) && (x <= 60)) ) { cout << "You have hit a wall. Try again."; x = 54; y = 0; //respawn to the closest checkpoint (54, 0) return 0; } //SEE IF A ROOM IS ENTERED //if the person enters the math room if( (y >= 1) && ((x >= 11) && (x <= 23)) ) { mathClass(); return 1; } //if the person enters the science class else if( (y <= -1) && ((x >= 11) && (x <= 23)) ) { scienceClass(); return 1; } //if the person enters the english class else if( (y >= 1) && ((x >= 35) && (x <= 48)) ) { //englishClass(); return 1; } //if the person enters the social studies class else if( (y >= -1) && ((x >= 35) && (x <= 52)) ) { //socialStudiesClass(); return 1; } else { return 0; //IF NOTHING APPLICABLE GIVEN, QUIT } }//moveStudentvoid mathClass(void){ int baseX, expY; cout << "\n\n--------------------------" << endl; cout << "You have entered math class. Greetings from Mr. Hayes!" << endl; cout << "This room allows you to calculate any number to the power of anything." << endl; cout << "What is the base number? "; cin >> baseX; cout << "What is the exponent? "; cin >> expY; cout << "The result is " << findThePower(baseX, expY) << endl;}double findThePower(double baseX, double expY){ double answer; answer = pow(baseX, expY); //answer is baseX ^ expY return answer;}void scienceClass(void){ int liquid1, liquid2; //number representing liquids liquid1 = liquid2 = 0; //initialize cout << "You have entered science class. Greetings from Mrs. Ameen!" << endl; cout << "This room allows you to combine 2 liquids to create a brand new concoction." << endl; cout << "1 - Soda\n2 - Water\n3 - Cough medicine\n4 - Oil" << endl; cout << "What liquids would you like to combine?" << endl; cout << "Liquid 1: "; cin >> liquid1; cout << "Liquid 2: "; cin >> liquid2; //determine concoction name mixThemUp(liquid1, liquid2);}int mixThemUp(int x, int y) //1 on success, 2 on failure{ int sum = x + y; //sum of the two liquids cout << "\nYour new concoction is "; switch(sum) { case 3: cout << "H2soda"; return 1; break; case 4: cout << "H2cough"; return 1; break; case (5): if((x == 2) && (y == 3)) { cout << "Water medicine" << endl; } else if((x == 1) && (y == 4)) { cout << "OilCO2" << endl; } return 1; break; case 6: cout << "H2oil" << endl; return 1; break; case 7: cout << "Cough oil" << endl; return 1; break; default: cout << "Incorrect numbers given" << endl; return 0; break; }}/*void englishClass(void){ //contents}void famousQuote(char[] quote){ //content}void socialStudiesClass(void){ //content}void getPopulation(int countryCode, int &x){ const long int USA = 296832191; const long int SPAIN = 40341000; const long int MEXICO = 107254702; const long int EGYPT = 78369461; const long int CANADA = 32865910; cout << "You can get the population of 1 of 5 countries:" << endl; cout << "1 for USA" << endl; cout << "2 for Spain" << endl; cout << "3 for Mexico" << endl; cout << "4 for Egypt" << endl; cout << "5 for Canada" << endl; cout << "Choice: "; cin >> countryCode; switch(countryCode) { case 1: cout << "Population of USA is " << USA << endl; x = USA; break; case 2: cout << "Population of Spain is " << SPAIN << endl; x = SPAIN; break; case 3: cout << "Population of Mexico is " << MEXICO << endl; x = MEXICO; break; case 4: cout << "Population of Egypt is " << EGYPT << endl; x = EGYPT; break; case 5: cout << "Population of Canada is " << CANADA << endl; x = CANADA; break; default: cout << "You did not enter a correct choice." << endl; break; }}void talkToAFriend(void){ //content}*/ it's not finished yet
  5. Lights Out

    program request

    [1]http://www.sqlcourse.com[2]http://www.sqlcourse2.comThey have practice databases set up. There are sort of "tasks" which you are supposed to complete to practice your SQL queries. It's really useful.
×
×
  • Create New...