Ask your own question, for FREE!
Mathematics 17 Online
OpenStudy (bahrom7893):

Hey programming/math gurus, I need some help. Not hard, but may be tedious =/ !

myininaya (myininaya):

i'm just a cheerleader

OpenStudy (bahrom7893):

Okay i had this assignment (attached), and I just finished my program. Now I need to compare my results with the professor's results.

OpenStudy (bahrom7893):

Here are the two files:

OpenStudy (bahrom7893):

Okay now can you guys play around and enter some values and see if my proggie gives the same results as the professor's

myininaya (myininaya):

hey bahrom thats really cool

myininaya (myininaya):

wow how do you even make a program into dos like that? we do call that dos right?

OpenStudy (bahrom7893):

yea.. and that's like really basic stuff.. took me like 3-4 hours..

myininaya (myininaya):

whats this class called? programming?

OpenStudy (bahrom7893):

It's making those nice (non-dos, or however you call those programs) is hard.. Yeah it's called Algorithms and Computer programming

myininaya (myininaya):

are you a computer science major?

OpenStudy (bahrom7893):

No I'm a math major, wanna minor in programming.. A deadly weapon to get the job haha!

OpenStudy (bahrom7893):

actually a deadly combination of weapons.

myininaya (myininaya):

i hope someone will come to help with the program lol because i know nothing :(

myininaya (myininaya):

do you want me to run tests to see if you and your professor i have the same outputs for inputs?

OpenStudy (bahrom7893):

yea

OpenStudy (bahrom7893):

LOL no myininaya i'm done with it. I just want to check if the answers I get are correct. I actually already tested for the first option. Like run my program right. When it asks you for a choice press 3, and then enter a random number like 55890. Then you will get the output. Then open my professor's version and again press 3 and enter the number 55890 again. Compare the answers u get

myininaya (myininaya):

k

OpenStudy (bahrom7893):

sorry the post right above this was meant to be posted earlier. So yea that's basically what i want u to do. just run tests

OpenStudy (bahrom7893):

actually myininaya hold on.

myininaya (myininaya):

holding...

OpenStudy (bahrom7893):

Let me give u which numbers to test. I already tested this for two programs, so my head is spinning, especially after writing and editing 181 lines of code.. so I will give you 12 numbers to test. gimme a second. those are the ones that are split into intervals basically that's why i need to make sure they work. so if that works, then everything in between will work too

OpenStudy (bahrom7893):

gimme 2-3 minutes

myininaya (myininaya):

k i have started my stop watch

myininaya (myininaya):

jk i don't have one

OpenStudy (bahrom7893):

okay here we go

OpenStudy (bahrom7893):

0 1000.99 8375 10021.87 34000 50781.6 68650

OpenStudy (bahrom7893):

test these meanwhile.. four more numbers coming and that's all

OpenStudy (bahrom7893):

100701.5 104625 150000.9 186825

OpenStudy (bahrom7893):

Okay those are the values that need to be tested

OpenStudy (bahrom7893):

Hey imran it wasn't that bad

OpenStudy (bahrom7893):

Wanna take a look at the source code?

OpenStudy (anonymous):

Yeah

OpenStudy (bahrom7893):

okay.. hold up.. it's a .cpp but notepad should open it

OpenStudy (bahrom7893):

Took me like 3 hours haha

OpenStudy (bahrom7893):

lol so how was it? Any nicer/shorter way?

OpenStudy (anonymous):

sooooooooooooooo many conditional statements

OpenStudy (bahrom7893):

I knoow man.. that took forever... but there were a $#!tload of conditions

OpenStudy (bahrom7893):

http://assets.openstudy.com/updates/attachments/4e31fa850b8ba7b2da414f03-bahrom7893-1311898304490-assignment1.png See the assignment.. like it has 3 columns basically.. those were what i used as a switch

myininaya (myininaya):

for 3 all them are good

OpenStudy (bahrom7893):

thanks a lot myininaya!

OpenStudy (bahrom7893):

anyway imran and for each of the 6 intervals on the table I had to write a condition. So i ended up with 18 conditions that was craaazzyyyyy

OpenStudy (bahrom7893):

anyway on to work on the next proggie..

OpenStudy (anonymous):

Use function on next program

OpenStudy (bahrom7893):

what do u mean? Well it's like different i have to let the user input four integers and sort them in order, smallest to largest. Your program should sort these numbers using if or if-else statements only

OpenStudy (anonymous):

"if or if-else statements only" that sucks, would have been so much easier with for loops

OpenStudy (bahrom7893):

lol I thought so.. anyway this is how I'm trying to do it.. Instead of thinking of all 24 possibilities that the arrangement can be.. i wanna first take the first two integers and put them in order

OpenStudy (bahrom7893):

then take the next two integers and put them in order..

OpenStudy (bahrom7893):

and finally arrange the 2 pairs in order again..

OpenStudy (anonymous):

I am writing my own program in mathematica

OpenStudy (bahrom7893):

good.. imran let's go to a new thread.. i will post the question in a bit

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!