User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 427,199 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,266 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 359 | Replies: 4
Reply
Join Date: Jan 2008
Location: India
Posts: 160
Reputation: sbv is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 7
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

Help Log is here. But Code ?? How to get this?

  #1  
Mar 12th, 2008
Hi all......

Here is my requirement. I am clear with my logic. But i am blocked at Code. How can i get this...

Here is the example...
I need to produce a Score card.
Where i need to calculate score of a dealer as per Question category and the Customers reply.
I am trying to clear my Need here.
Suppose The data is as Follows
1) dealer "A"
2) Question Category "1"
3) Number Of question in Category "1" = 2
4) Marks for Question = 1 (N) else 4(Y)

If Dealer "A" has 4 customers and 2 of them replied then.

Here are the Inputs for Scorecard.

1) Total Question for Dealer "A" of Category "1" => 2(Customers) * 2 (Questions) = 4
2) Marks = 4 * 4 = 16 (Considering Y case)
3) Total Marks = 16

Here the score of Dealer "A" is "100%" MI right? If yes then please tell me how to get this by calculation. Please Help me.

Thanks in advance.

Have a Nice Time.
Accept Challenges and Enjoy Coding... :)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2008
Location: India
Posts: 160
Reputation: sbv is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 7
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

Re: Log is here. But Code ?? How to get this?

  #2  
Mar 12th, 2008
Hi
FYI. i am trying to implement this with crystal report and view.
Thanks.
Accept Challenges and Enjoy Coding... :)
Reply With Quote  
Join Date: Jan 2008
Location: India
Posts: 160
Reputation: sbv is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 7
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

Re: Log is here. But Code ?? How to get this?

  #3  
Mar 18th, 2008
hey guise please help me.
Accept Challenges and Enjoy Coding... :)
Reply With Quote  
Join Date: Sep 2007
Posts: 1,057
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Log is here. But Code ?? How to get this?

  #4  
Mar 18th, 2008
Not sure exactly what you mean here, but for your info, for calculating it easily, avoid 1 and 4 for yes and no.

Use 0 for no, 1 for yes. This way:
2 questions right, 2 questions wrong
0 + 2 = 2
2/4 = 50%

For 1 and 4, you are looking at some intense calculation, or substituting like the following:
if 1 then 0, if 4 then 1.

You can do it anyway you wish, but if they get it wrong, do NOT add any points. Otherwise your calculations will be just about impossible.

If you wish, keep it 0 and 4. Then just divide by 4.

2 right, 2 wrong
8/(4*4)
(Total Points) / (Points per correct answer * number of questions)

Something like this would work for your current situation:
  1. Dim y As Integer = 0
  2. Dim n As Integer = 0
  3. Dim Questions() As String = {1,4,4,1,4,4,4,4,1,4}
  4.  
  5. For Each answer As Integer In Questions
  6. Select Case answer
  7. Case 1 : n += 1
  8. Case 4 : y += 1
  9. End Select
  10. Next
  11.  
  12. Dim percentRight As Decimal = FormatNumber((y/(n+y))*100, 1)
  13.  
  14. Response.Write(percentRight & "%")
Now if you had it 0 for no, 1 for yes, then all you would have to do is count each element and sum them all up.

Then divide the sum by the total count and you would have it. Make sure it's decimal, as if you put integer, it will round to the nearest whole number.

An example of this would be:
  1. Dim Questions() As String = {0,1,1,0,1,1,1,1,0,1}
  2.  
  3. Dim percentRight As Decimal = FormatNumber((Questions.Sum()/Questions.Length)*100, 1)
  4.  
  5. Response.Write(percentRight & "%")
Last edited by SheSaidImaPregy : Mar 18th, 2008 at 10:04 am.
Reply With Quote  
Join Date: Jan 2008
Location: India
Posts: 160
Reputation: sbv is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 7
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

Re: Log is here. But Code ?? How to get this?

  #5  
Mar 19th, 2008
hi
Thanks for reply. But i need to develop this all in Crystal report as i told. i need to design and develop a score card.
Accept Challenges and Enjoy Coding... :)
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 10:37 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC