We are about to switch to a new forum software. Until then we have removed the registration on this forum.
my question is, how do i calculate and have it display on the display screen?
Employee ID Employee Name Hours Worked 1 Alabaster Snowball 40 2 Bushy Evergreen 25.5 3 Pepper Minstix 45 4 Sugarplum Mary 42
What I have all ready int x=10; int y=70; PFont f; float hoursWorked[];
void setup() { size(1000,400); fill(0); f = loadFont("Calibri-30.vlw"); textFont(f,30); // load the files String [] stuff = loadStrings("hoursWorked.txt");
String [] employeeName = loadStrings("employeeName.txt");
String[] id = loadStrings("id.txt");
hoursWorked=float(split(stuff[0], ','));
for (int i = 0; i < 4; i++) {
print(id[i]);
print("\t");
print(employeeName[i]);
print("\t");
print(hoursWorked[i]);
println();
//ID Number
text(id[i],x+ i+30, y); //ID Number text(employeeName[i],x+ i+80, y); //Hours Worked text(hoursWorked[i],x+ i+600, y); y=y+70; } }
double pay(double hours) {
if ( hours <= 40) return hoursRATE; else return (40RATE)+((hours - 40)RATE1.5);
}
Answers
Please format your code. Edit your post (gear on top right side of any of your posts), select your code and hit ctrl+o. Leave an empty line above and below your block of code. Details here: https://forum.processing.org/two/discussion/15473/readme-how-to-format-code-and-text
Kf
please also format the data as if it were code
since this is homework:
hm.... OR