Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

infernowheels

Member
  • Content Count

    164
  • Joined

  • Last visited

Awards


This user doesn't have any awards

1 Follower

About infernowheels

  • Title
    Junior Member
  • Birthday 1987-06-18

Profile Information

  • Gender
    Not Telling
  • Location
    In a poor and corrupted country
  • Interests
    Everything Computer.
  • Biography
    Human Beatboxer/Tech Geek/Gamer
  • Occupation
    Student

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I'm interested in the new Blade 14, that much power would be really handy in my upcoming 3D Animation classes. Congrats for 3 Million Subs LTT, and thank you Razer for the awesome stuff!
  2. I think it'd be really cool to use that projector to play Doom on 4K DSR on my Nvidia Geforce GT 430 derp :3
  3. Hey guys, I have 14 LEDs and I need them to be turned on and off using buttons in Visual Basic and an Arduino. This was my reference: http://www.instructables.com/id/Using-Visual-Basic-to-control-Arduino-Uno/ Using the code there, I was able to control the LED on PIN13. However, when trying to modify both codes to add an additional LED, it simply doesn't work for me. What codes should I add to make at least another LED be controlled? Any help would be greatly appreciated!
  4. Hey guys, we were tasked to design the Philippine flag using Visual Basic. Supposedly, each part of the flag should appear in sequence using a Timer. However my real problem is how to design the sun's rays and the stars, I have no idea which combination of commands to use as we have only just been introduced to Graphics and Timers. Any help would be appreciated! ~Using VB 2010~ <My current progress is downloadable below> https://app.box.com/s/rvypm2m6aj4fmkihqhb9m6xvl9a3g1l5
  5. Username: infernowheels https://www.vessel.com/videos/JYZEYDYx0 https://www.vessel.com/videos/aBRl_4ZS6 Shares: https://twitter.com/CeeeeeeeeeJ/status/580778551307194368 https://www.facebook.com/carljamesj/posts/10205351168892758
  6. Thanks for the suggestion, however just to keep things more original.. I decided to change the string into an array of chars... So the code goes like this for (int x = 0; x < 50; x++) { if(p[b].studentName[x] == ' ') { for (int y = x+1; y < 50; y++) { cout << p[b].studentName[y]; //if(p[b].studentName[y] != 'A - Z' || p[b].studentName[y] != 'a - z') } } } cout << ", "; for (int z = 0; z < 50; z++) { if(p[b].studentName[z] != ' ') { cout << p[b].studentName[z]; } if(p[b].studentName[z] == ' ') { break; } } This thing almost works perfectly however I can't make the loop terminate when it's done ouputting the last name... faulty part of the code is the line with the comments(I know it's wrong but I just want to give an idea as to how I want that line to work.)
  7. Based on the instructions given by the problem, I can only use one identifier for the name.
  8. I think you read my problem wrong... I need to ouput only one identifier but it won't output the identifier's entire string value rather it has to find the space in the string so that it could separate the First Name and Last Name within one Identifier known as studentName Anyways, I modified my code a bit using a code from an example I found online, however, the program crashes after inputting the score .-. <I recombined the functions to make this more pleasing to the eye> #include<iostream>#include<string>#define MAX 20using namespace std;struct studentType{ string studentName; int testScore; char grade;};main(){ studentType p[MAX]; int highest = 0, lowest = 100; int d, e, f[MAX], index[MAX]; for(int a = 0; a < MAX; a++) { cout << "Enter your name: "; getline(cin, p[a].studentName); index[a] = p[a].studentName.find(' '); f[a] = index[a] + 1; A: cout << "Enter a score: "; cin >> p[a].testScore; if(p[a].testScore < 0 || p[a].testScore > 100) { cout << "Invalid input." << endl; goto A; } cout << endl; } cout << endl; for(int b = 0; b < MAX; b++) { cout << p[b].studentName[f[b]] << ", " << p[b].studentName[f[b+1]] << endl; cout << "His/her score is: " << p[b].testScore << endl; if(p[b].testScore >= 90) { p[b].grade = 'A'; } else if(p[b].testScore >= 80 && p[b].testScore < 90) { p[b].grade = 'B'; } else if(p[b].testScore >= 70 && p[b].testScore < 80) { p[b].grade = 'C'; } else if(p[b].testScore >= 60 && p[b].testScore < 70) { p[b].grade = 'D'; } else if(p[b].testScore < 60) { p[b].grade = 'F'; } cout << "With an equivalent letter grade of: " << p[b].grade << endl; cout << endl; } for(int c = 0; c < MAX; c++) { if(p[c].testScore > highest) { highest = p[c].testScore; d = c; } if(p[c].testScore < lowest) { lowest = p[c].testScore; e = c; } } cout << "The student with the highest score is: " << ", " << p[d].studentName << " with a score of: " << highest << endl; cout << "The student with the lowest score is: " << ", " << p[e].studentName << " with a score of: " << lowest << endl; system("pause");return 0;}
  9. Most of the syntaxes of your code are not familiar to me, care to explain the flow of your code?
  10. Hey guys, so my code already works, I just need it to be modified so that instead of having studentName and studentLastName as two separate identifiers, I could just use one to contain the whole name and just make a code that finds the First Name and Last Name so they can be outputted like "Last Name, First Name". Any help would be appreciated! #include<iostream>#include<string>#define MAX 20using namespace std;struct studentType{ string studentName; string studentLastName; int testScore; char grade;};void read(studentType p[]){ for(int a = 0; a < MAX; a++) { cout << "Enter your FIRST Name: "; cin >> p[a].studentName; cout << "Enter your LAST Name: "; cin >> p[a].studentLastName; A: cout << "Enter a score: "; cin >> p[a].testScore; if(p[a].testScore < 0 || p[a].testScore > 100) { cout << "Invalid input." << endl; goto A; } cout << endl; }}void assign(studentType p[]){ cout << endl; for(int b = 0; b < MAX; b++) { cout << "Student's name: " << p[b].studentLastName << ", " << p[b].studentName << endl; cout << "His/her score is: " << p[b].testScore << endl; if(p[b].testScore >= 90) { p[b].grade = 'A'; } else if(p[b].testScore >= 80 && p[b].testScore < 90) { p[b].grade = 'B'; } else if(p[b].testScore >= 70 && p[b].testScore < 80) { p[b].grade = 'C'; } else if(p[b].testScore >= 60 && p[b].testScore < 70) { p[b].grade = 'D'; } else if(p[b].testScore < 60) { p[b].grade = 'F'; } cout << "With an equivalent letter grade of: " << p[b].grade << endl; cout << endl; }}void find(studentType p[], int &highest, int &lowest, int &d, int &e){ for(int c = 0; c < MAX; c++) { if(p[c].testScore > highest) { highest = p[c].testScore; d = c; } if(p[c].testScore < lowest) { lowest = p[c].testScore; e = c; } }}void print(studentType p[], int &highest, int &lowest, int &d, int &e){ cout << "The student with the highest score is: " << p[d].studentLastName << ", " << p[d].studentName << " with a score of: " << highest << endl; cout << "The student with the lowest score is: " << p[e].studentLastName << ", " << p[e].studentName << " with a score of: " << lowest << endl;}main(){ studentType p[MAX]; int highest = 0, lowest = 100; int d, e; read(p); assign(p); find(p, highest, lowest, d ,e); print(p, highest, lowest, d ,e); system("pause");return 0;}
  11. Thanks~! Got it, much appreciated! Program is now doing what it was intended to do~ Marking as solved. Noted, I know I could've just used a different process to get the same result but goto just seemed more convenient for me.. Anyways, I guess I'll find out how it can lead to mistakes once I do get to code more complicated programs.
  12. Understood. I've done what I could and now there is no problem when compiling the program.. However, when ran, it crashes at the point when it has to output the person with the lowest score... Also, it seems that the program fails in getting the correct highest score, not with the lowest score though... Seems odd :< Current source code: #include<iostream>#include<string>#define MAX 3using namespace std;struct studentType{ string studentName; string studentLastName; int testScore; char grade;};void read(studentType p[]){ for(int a = 0; a < MAX; a++) { cout << "Enter your FIRST Name: "; cin >> p[a].studentName; cout << "Enter your LAST Name: "; cin >> p[a].studentLastName; A: cout << "Enter a score: "; cin >> p[a].testScore; if(p[a].testScore < 0 || p[a].testScore > 100) { cout << "Invalid input." << endl; goto A; } cout << endl; }}void assign(studentType p[]){ cout << endl; for(int b = 0; b < MAX; b++) { cout << "Student's name: " << p[b].studentLastName << ", " << p[b].studentName << endl; cout << "His/her score is: " << p[b].testScore << endl; cout << endl; }}void find(studentType p[], int highest, int lowest, int d, int e){ for(int c = 0; c < MAX; c++) { if(p[c].testScore > highest) { highest = p[c].testScore; d = c; } if(p[c].testScore < lowest) { lowest = p[c].testScore; e = c; } }}void print(studentType p[], int highest, int lowest, int d, int e){ cout << "The student with the highest score is: " << p[d].studentLastName << ", " << p[d].studentName << " with a score of: " << highest << endl; cout << "The student with the lowest score is: " << p[e].studentLastName << ", " << p[e].studentName << " with a score of: " << lowest << endl;}main(){ studentType p[MAX]; int highest, lowest; int d, e; read(p); assign(p); find(p, highest, lowest, d ,e); print(p, highest, lowest, d ,e); system("pause");return 0;}
  13. Sorry for the late reply, had to do go to school. Thanks for your reply, it's working now. I'll be doing the other functions by myself now, I'll update you if I any more problems occur/if I have more questions/if I'm already done.
  14. read(studentType p[]); Like that? Error is now " expected primary-expression before "p" " I also tried read(studentType p[MAX]); Same error.
×