Log in

No account? Create an account

Previous Entry | Next Entry

another ga chat.

I *really* need to finish "chat logging" and "expert rating". just a couple more hours, I hope. Mostly just having trouble concentrating on it as it's an uninteresting problem at this point.

User was searching for: a program that determines the winner of a sales contest would in put the number of units sold by each salesperson. the one who sell the most winnes. use a series of 10 single digit number as characters a determine the winner.
** joined: guest
** joined: nentwined
guest: Hi
nentwined: howdy. :)
nentwined: what are you looking to use this program for? or was this a "test" search?
guest: i am in html class and need to know how to think in a problem solving way
nentwined: hmm. you can't really do the above in html. are you learning javascript as well?
guest: its structure building and java
guest: yes!
nentwined: er -- java or javascript? and structure as in data structures, I presume? fun stuff. lemme see if I can help you deconstruct the problem... :)
guest: o.k.!
nentwined: so at the most basic level, it's input and output, which is most things. do you know how many salespeople there are to begin with? i.e. can you have a precise number of form elements?
guest: no! the question is the process of finding the largest value is used frequently in computer applications. for example, a program tht determines the winner of a sales contest would input the number of units sold be each salesperson. the salesperson that sells the most units wins the contest.
guest: then it said to design an application that inputs a series of 1- single digit numbers as characters, and determines and prints the largest of the number
nentwined: and this all goes on a web page somewhere? well, if you can only take in one element at a time, what I would do is one text input element, one button connected to a javascript function, and one... text area or something to display the 'current largest'... when they input a number, you verify they entered a number... and if it's smaller than the current "large number" you ignore it, and if it's bigger than the current "large number" you make that your new large number and update the output... does that make any sense? :)
nentwined: a standard way to end a list of numbers is when a user inputs "-1"... so if you wanted to you could not display anything until they typed in -1... (but still keep the logic the same... you never need to remember anything other than the current largest number)
guest: o.k!
guest: well! what about this one
nentwined: :heh: :) fire away. :)
guest: Because of energy conservation, ecology and hogh price of gasoline, drivers are concerned with miliage obtained by their automobiles.one diriver has kept track of several tanks of gasonline by recording miles driven and gallons used for each tank. the program
guest: the program should calculate and display the miles per gallon obtained for all tanks up to this point. all average calculations should produce floating-point results. use two texfields to input the data
nentwined: hmm. two textfields means one for number of miles, one for number of gallons. so be sure to label those clearly. then you're doing the same thing as the first problem, basically. keep a total number of miles and a total number of gallons. divide for display. (keeping the totals instead of a current average is better form -- more precise. keeping a running average leads to unsightly rounding errors)
guest: o.k.!
nentwined: anything else I can do you for? :)
guest: yes1
nentwined: :hehe:
guest: are you ready?
nentwined: certainly. just hacking away at globealive in my spare cycles. :)
guest: Develop an application that will determine if a department store customer has exceeded the credit limit on a charge account. for each customer, the following facts are available:
guest: a- account number
guest: b-balance at the end of the month
guest: c-total of all items charged by this customer this month
guest: d-total of all credits applied to this customers' account this month
guest: e-allowed credit limit
guest: the program should input each of the facts from Textfields as integers, calculate the new balance(=beginning balance=charges-credits), display the new balance and determine if the new balance exxceeds the customers' credit limit.
guest: for those customes whose credit limits is exceeded, the program should display the message,"credit limit exceeded
nentwined: okay. well, just to do things as simply as possible... you'll notice you don't need the account number for anything. make sure to give each textfield a unique name to make accessing them easier... and then it's just e-(b+c-d) ... that's the current available credit. as for display, I'd just do a little popup alert box because they're simple. :)
nentwined: (not really anything to that one, compared to 1 and 2...)
guest: lol!
guest: laugh out loud!
nentwined: :)
guest: no ! on the other hand you may wake somebody!!!
nentwined: yeah. gf's asleep in the other room. :)
guest: I have to do structurebuilding how would i do that with a problem similar to these?
nentwined: again, presuming by structure you mean data structure... hmm. I don't know offhand with javascrit. but I do have a book. one moment. :)
guest: o.k.!
guest: it's were you have to link then you have the yes for the right solution and no for wrong, but it has to loop back around to be able to continue rotating
guest: you have a start point and a stop what way work and what way won't
nentwined: oy, it's been a very long time since I fudged with javascript. I really hate that stuff. :) so as far as I can tell, there's no "formal" declaration of a data structure in javascript -- you just pretend it exists, and it does. having said that, I don't really understand the question you're posing, so I can't immediately give you an example for that... but basically since any variable can hold any sort of data... you could have a variable "list". and list.next could be assigned list, which would give you a circular list. or you could point list.yes to one thing and list.no to another thing...
guest: it starts with the declare variable
nentwined: I have some really simple (not necessary useful) javascript code on http://erif.org, showing a really simple data structure... (view source) :) hmm. [looks for a better link]
guest: o.k.! thank you!
guest: please continue to have a Blessed Day!
guest: i need to practice for my test this morning
nentwined: :heheh: good luck on that. here's one thing that might help you understand the list thingy -- http://www.mychandu.homestead.com/computers.html -- I haven't looked at it, but... :)
nentwined: really the structure you're describing is a "tree", but a tree is just a linked list with more than one "next" (a next-yes and a next-no, or in more common vernacular a "left" and a "right" :)
guest: o.k! thank you very much! yes it is!
nentwined: =) good luck on your test, and I'll do my best not to come down with a cold. hoping it's just the vaccuming earlier. :)
guest: Thank you ! i have an hour before i have to get ready to go
nentwined: :)
guest: Thanks!
nentwined: my pleasure. :) [to end chat, just close this window] :)
** unjoined: guest


( 2 comments — Leave a comment )
Nov. 26th, 2002 07:29 am (UTC)
ha, you did a really good job helping that kid with his homework. I like how it was a friendly sort of interaction. At google, we always have to be very formal and annoyingly professional. We even have rules about how to say hello and goodbye to customers. I like GA's way better :) you seem to have solved the problem and gained a loyal customer in the process.
Nov. 26th, 2002 02:59 pm (UTC)
stodgy stodgy stodgy :heh: I don't do it very well. there's going to be a checkbox for users to select if the expert was abusive, just in case. :)
( 2 comments — Leave a comment )

Latest Month

February 2016


Page Summary

Powered by LiveJournal.com
Designed by chasethestars