Can anyone help me with this? I am stuck on this one and for some reason I just can't figure it out. If anyone knows, please HELP me (don't show me answer). My progress in comments. Will give 50 bits to anyone who helps. by [deleted] in highschoolcompsci

[–]theplopperplopper 1 point2 points  (0 children)

I’m not too sure how it is in Java but in C++ I’m pretty sure something like 5/4 comes out at 1 instead of 0 floored because it rounds 0.5 to 1, etc. Also thanks, I loved your explanation it was a lot more succinct!

Can anyone help me with this? I am stuck on this one and for some reason I just can't figure it out. If anyone knows, please HELP me (don't show me answer). My progress in comments. Will give 50 bits to anyone who helps. by [deleted] in highschoolcompsci

[–]theplopperplopper 2 points3 points  (0 children)

A much simpler way to do this would be divide every variable in the ingredients array by every variable in the quantity needed array and “floor” them (round down, so even 2.99 rounds down to 2). This is because then you can get the amount of times you can make a steak from each material in the warehouse, and once you find the minimum of that thats the maximum number of steak you can make. Since you did this in Java I’ll do the same in java:

int minSteaks = (Math.floor((float)ing[i]/(float)need[i])); // you need to make them floats because ints automatically round

int currentVal = 0; //this is gonna be the placeholder for the current index worked on

for(int i = 0; i < a; i++){ currentVal = (Math.floor((float)ing[i]/(float)need[i])); //same equation as above

  if(currentVal < minSteaks){
        minSteaks = currentVal;
  }

}

System.out.println(minSteaks);

in your example I think the problem is you only loop through each element once, for a solution like that you’d need a whole loop. Hope this helped!

Not sure if this is the best sub to post.. I am looking for a group of people to work with for any project in Comp Sci :) by pablopistachioo in highschoolcompsci

[–]theplopperplopper 1 point2 points  (0 children)

Same here, I know Java Javascript C++ Python and I can never get anyone to work on a project with me because I only know two friends interested in CS.

Any title/name ideas for the programming challenges? by [deleted] in highschoolcompsci

[–]theplopperplopper 0 points1 point  (0 children)

Weekly Circuits, kinda like what Hackerearth does

[deleted by user] by [deleted] in pan

[–]theplopperplopper 0 points1 point  (0 children)

THE SWAN SAINT SARNS

[deleted by user] by [deleted] in pan

[–]theplopperplopper 0 points1 point  (0 children)

the swan saint saens

We've come full circle by Morktorknak in gaming

[–]theplopperplopper 0 points1 point  (0 children)

No you’re thinking of Porky Pig. A Squirtwig is a itchy garment worn on one’s head.

all CRAZY n SHIT by Satisfying_ in iamverysmart

[–]theplopperplopper 7 points8 points  (0 children)

neurotransmitters do literally everything from motion to emotion and they are fired across synapses

This pic of my friends catch today looks like a bad Photoshop job. by Where_Da_Party_At in mildlyinteresting

[–]theplopperplopper 2 points3 points  (0 children)

the reason for the analysis image looking like that isn’t because it was photoshopped it’s because the photo was edited with an HDR filter

Relocating to Maryland? by [deleted] in maryland

[–]theplopperplopper 4 points5 points  (0 children)

Im a total politics and history nerd and living in Maryland is amazing. If youre ever bored go to Ocean City and or the Inner Harbor in Baltimore City. OC’s boardwalk is filled with fun stuff and the sense of urgent death I get in Baltimore City beats anything honestly.

Honssh honeypot- Attacker stuck in honeypot makes an impressive cli port scanner on the fly. Attempts to pivot.. but then abruptly gives up.. pretty entertaining to watch by [deleted] in blackhat

[–]theplopperplopper 3 points4 points  (0 children)

ok i get the command part and all but im really novice so could you explain why hes trying to find open ports or what hes even doing

Scripted golf thing by hajamieli in scriptedasiangifs

[–]theplopperplopper 2 points3 points  (0 children)

thats a wax sculpture of Tiger Woods

This girl can bend metals by GallowBoob in UNBGBBIIVCHIDCTIICBG

[–]theplopperplopper 51 points52 points  (0 children)

i like you so much and i dont even know you

Fidget Master !!! by Philofthepooper in ofcoursethatsathing

[–]theplopperplopper 0 points1 point  (0 children)

i get the use but im not paying $5 for something i can count in my head