Hello everyone, I am posting this more generically in the software development section to see what might be available and to increase a possible success rate. But enough of that let's get to the question at hand. Recently, in C#, I started back up a project of mine to do RSA encryption. Part of what makes an RSA cipher successful is the production of large, random numbers, that are prime. For my project, I am using a library that uses random.org to seed a random number generator, and then producing VERY large values that must be stored in BigIntegers (for …

Member Avatar
Member Avatar
+0 forum 15

I'm studying for a test and appreciate your help. How to calculate the running time (T(n)) of the following segment (written in Pascal): k := 0; m := n; while m <= n do begin k := k + 1; m := k * k; end; for i := 1 to k do for j := i to k do begin s := s + m; m := m - 1; end;

Member Avatar
Member Avatar
+0 forum 1

OK I know the DateTime structure is very good at doing this. But if you ever wanted to design your own calendar, or just wanted to know how things are possibly done, this could be a handy function. Enjoy.

Member Avatar
Member Avatar
+0 forum 1

hey guys! this is my first post to daniweb. and also i've not been so long on php. i m trying to manage customer transection records but stuck on one place and i need help.. here is my mysql table for transection of customer id-1 => +-----+------+----------+--------+------+-------| | svn | cid | date | samt | rvn | ramt | |-----+------+----------+--------+------+-------| | 1 | 1 | 2014/3/1 | 5000 | | | | | 1 | 2014/3/4 | | 2 | 2000 | | 4 | 1 | 2014/3/7 | 4000 | | | | | 1 | 2014/3/9 | …

Member Avatar
Member Avatar
+0 forum 5

I am tring to perform a calculation in my query. I've been working on it for hours, so I need another pair of eyes to see what I am missing. Everything in the query is working except for the g.courseFee part. The course fee is not being added to the calculation. I am not sure if the issue is in the select clause or the left join clause. Below is my query and any help is greatly appreciated: SELECT COALESCE(SUM(c.amount),0)+COALESCE(SUM(g.courseFee),0) AS 'Balance', a.termCode as 'Term', a.stuID AS 'Student ID', CONCAT(d.lname, ', ', d.fname) AS 'Student Name', a.comment AS Comment FROM …

Member Avatar
Member Avatar
+0 forum 3

First thing is this is a long question. So please first read it then give me your suggestion. currently i am working on a banking projects for my degree. Where i am implementing a simple bank savings account. Where account holder can deposit and withdraw money. The account starts with a opening balance. Then user can add or withdraw money. And also i have to calculate their interest (Flat 4% per year). The following transaction is to be made Date TNX Type Amount Interest Remaining LastTXDate 01/03/13 + Opening + 10000 0.00 10000.00 01/03/13 15/03/13 + Deposite + 5000 0.00 …

Member Avatar
Member Avatar
+0 forum 2

I'm quite new to programming and i'm trying to write a formula to work out the capacitance of capacitors - and is what I have below. I then want to convert the value I have (in pico farrads) into micro farrads. Here's what I have so far: while True: x=float(input("First number: ")) y=float(input("Second number: ")) z=float(input("Third number: ")) x=int(x) y=int(y) z=int(z) print(int(str(x)+str(y))*10**z) replay=input("Would you like to calculate again? (yes/no) ") print('\n') if replay=="no": print("...Terminated Program.") break print('\n') I want to assign the variable 'pf' to the result of line 11, so that I can then multiply the result by *10**-3. …

Member Avatar
Member Avatar
+0 forum 3

Hi pals, I am looking to find a modulus calculation using my casio fx-991 ms calculator i know how to find modulus using small numbers eg: 7 mod 3 = 1. This because 7 = 3(2) + 1, in which 1 is the remainder. To do this process on a simple calculator do the following: Take the dividend (7) and divide by the divisor (3), note the answer and discard all the decimals -> example 7/3 = 2.3333333, only worry about the 2. Now multiply this number by the divisor (3) and subtract the resulting number from the original dividend. …

Member Avatar
+0 forum 0

Hi, I am using jQuery function to calculate total of item price (label) multiply by quantity (textbox), this is working fine so far. Also, I added additional label for shipping which getting the data from rbl object, also working fine. The calculation I'm trying to get is sum of total+shipping, once I add this code i'm getting strange numbers on the total label. **Here is the total+shipping code:** `$("[id*=lblTotalFishShipping]").html(parseFloat($(".sumOrder").html()) + parseFloat($("[id*=lblTotalFishShipping]").html()));` **Here is the full function:** <script type="text/javascript"> $(function () { $("[id*=quoteOrderAmount]").val("0"); }); $("[id*=quoteOrderAmount]").live("change", function () { if (isNaN(parseInt($(this).val()))) { $(this).val('0'); } else { $(this).val(parseInt($(this).val()).toString()); } }); $("[id*=quoteOrderAmount]").live("keyup", function () …

Member Avatar
Member Avatar
+0 forum 5

I am trying to teach myself PHP, im trying to generate a form that validates in php Im having issues with my checkbox value calculations I know i should construct a function Im trying to make it so if the user clicks the mealplan box the appropriate price gets added to the convention cost. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <head> <style> body { background-color:#FF00FF; } h1 { color:orange; text-align:center; } p { font-family:"Times New Roman"; font-size:20px; } h1 {text-align:center; } </style> <title>Assignment3</title> </head> <body> <h1>Personal Information </h1> <?php // define the variables $fName …

Member Avatar
Member Avatar
+0 forum 1

Hi, i want to calculate elasped time in Mintues excluding after 6pm and the weekends. for instance i have a start time on 2013-01-11 2:37:20 PM and need to calculate the time difference with repect to current time(NOW) in minutes by satisfying above 2 conditions. i've been trying to do this for while and kind of lost now. any help greatly appericated. i've tried this but to exclude the weekend but it's not working as per expectation.

Member Avatar
Member Avatar
+0 forum 6

Hi everyone, I have a little problem with my code right now. For a project, we are to create a snack machine with cookies and mints using a GUI. We are given nickels, dimes, and quarters to enter in. The problem is when I enter in 1 nickel and 6 dimes, it doesnt work. It also doesnt work when I input 7 nickels and 3 dimes. These are the 2 combinations out of all that I tried that doesnt work(I believe I tried all possible combinations). Below are snippets of my code. package proj3; import java.awt.Color; import java.util.ArrayList; public class …

Member Avatar
+0 forum 0

Hi, I'm writing a simple program that runs a vending machine. I thought I had everything working fine untill I messed around with the money input some more. In my program I obviously compare money values and check to make sure the values match up exactly to buy an item. It works under almost every case, but I have found some cases where I get an anomalous decimal value that throws off the comparison of the double values. Here is my code and output from testing within the money class itself. public class Money { private static final double NICKEL_AMMNT …

Member Avatar
Member Avatar
+0 forum 3

Hello there. I am kind of confused. In PHP I substract two unix timestamps from each other. The first: mktime(0, 0, 0, 10, 22, 2012) The second: mktime(24, 0, 0, 10, 28, 2012) For as far as I know the time difference between these two timestamps is exactly 7 days. What I get, however, when I substract the second from the first ($time_difference = $second_timestamp - $first_timestamp) and then divide it by a week (60 * 60 * 24 * 7) is not **1**, but **1.0059523809524** (which equals 1 week and 1 hour)! Wtf?! Can someone please explain? :p

Member Avatar
Member Avatar
+0 forum 3

i have 5 form that with 4 form to enter input and the last form is to make a calculation and display the output.But the problem is,i cannot get the calculation and the output to be played because the last form does not attach the input that i have enter in form 1 to 4.can anybody please help me with this solution?

Member Avatar
Member Avatar
-1 forum 2

Hey guys i am having a small problem with this calculation in bold: **amtwon = (pow(pbet,2) / pow(pbet,2-100 *pbet))** ; amtlost = ( 0.35 * pbet); totalwin = (amtwon - amtlost); this is the block of code.the problem is **amtwon** totalwin is supposed to return a value of 23.993.18 but i am seeing 1.# inf when calculated what the heck am i doing wrong. mind you i multiplied the pbet variable by it self and it worked...ps i am using "double" for all these values

Member Avatar
Member Avatar
+0 forum 6

Hello everyone, I stumbled upon a video about the monty hall problem, which I found very well explained, and a lot of comments below the video that were against the conclusion that it **is better to switch**. To clarify, I wrote this small program that simulates the game and allows everyone to test it for themselves. I got the following results: + Calculation Preferences + Enter the amount of repetitions: 3000 Do you want to switch choice? [Y/N] y + Calculation Results + Amount of repetitions: 3000 Correct choices: 2008 Wrong choices: 992 Winpercentage: 66.933333 and: + Calculation Preferences + …

Member Avatar
Member Avatar
+0 forum 1

is it possible?? $a= 5; $b =10; $c= "+" $d= $a.$b.$c; How can I do dynamic calculation like this. I know this code will not work. But Just want to use opereater directly input through form. How can I prevent opreater to converting into string.

Member Avatar
Member Avatar
+0 forum 3

Hi, I would like to have a php script or javascript to calculate the array textboxes where values fetched from the database. My array textboxes code below: [CODE] $sql="SELECT * FROM records WHERE is_active = 'Yes'"; $result=mysql_query($sql,$connection) or die(mysql_error()); while ($row=mysql_fetch_array($result)) { $default_salary = $row["default_salary"]; echo "<input onkeyup=\"AddInputs()\" type=\"text\" class=\"validate[required,custom[onlyNumberSp],maxSize[5],minSize[3]] text-input\" id=\"default_salary[$id]\" size=\"4\" name=\"default_salary[$id]\" value=\"$default_salary\" >"; echo "</td>"; echo "<td width=\"\" align=\"left\" border=\"0\">"; echo "<input type=\"text\" class=\"validate[required,custom[onlyNumberSp],maxSize[5],minSize[1]] text-input\" id=\"additional_salary[$id]\" size=\"4\" name=\"additional_salary[$id]\" value=\"0\">"; echo "</td>"; } [/CODE]

Member Avatar
Member Avatar
+0 forum 5

Hi, I would like to have a php script or javascript to calculate the array textboxes where values fetched from the database. My array textboxes code below: [CODE] $sql="SELECT * FROM records WHERE is_active = 'Yes'"; $result=mysql_query($sql,$connection) or die(mysql_error()); while ($row=mysql_fetch_array($result)) { $default_salary = $row["default_salary"]; echo "<input onkeyup=\"AddInputs()\" type=\"text\" class=\"validate[required,custom[onlyNumberSp],maxSize[5],minSize[3]] text-input\" id=\"default_salary[$id]\" size=\"4\" name=\"default_salary[$id]\" value=\"$default_salary\" >"; echo "</td>"; echo "<td width=\"\" align=\"left\" border=\"0\">"; echo "<input type=\"text\" class=\"validate[required,custom[onlyNumberSp],maxSize[5],minSize[1]] text-input\" id=\"additional_salary[$id]\" size=\"4\" name=\"additional_salary[$id]\" value=\"0\">"; echo "</td>"; } [/CODE]

Member Avatar
+0 forum 0

I have a datagridview (unbound) that i want to calculate percentages based in a total. I already done the total (in a label.text). So what i want for the second column is to find out the percentage for each quantity that varies every time i enter a new quantity value. (This is my datagrid view) qty %_OF_Content 10 8.130 20 16.260 30 24.390 50 40.65 13 10.569 Total: 123 Please i honestly need help. Thsnk in advance:sad:

Member Avatar
+0 forum 0

The assignment requires program to read from a file into an array, use two boolean functions to validate certain data (set to "true" when there are no errors) then output any errors to a separate file. Everything works fine except for validating the rate. All the numbers are read into the array correctly and the calculation seems sound (works correctly on a calculator) but for some reason the calculation in C++ always results in 0 which makes EVERY record output an error. PLEASE HELP, it is driving me CRAZY :twisted: (the "cout" lines were inserted just so I could see …

Member Avatar
Member Avatar
+0 forum 4

like the title says how to calculate 10 days from a date with delphi, am after simple way to get 10 days trial from current date of usage can anyone help thanks :)

Member Avatar
Member Avatar
+0 forum 2

I just try to calculate 5.3 - 5, and the answer is a bit off. this is the code: [CODE]double answer = 5.3 - 5; println("answer = " + answer);[/CODE] and the output is: "answer = 0.2999999999999998" instead of 0.3. I use Eclipse on win 7 32 bit as a compiler and editor. Any idea why this is happening and how to fix this? tnx!

Member Avatar
Member Avatar
+0 forum 5

[CODE]I'm having trouble calculating the right interest expense. The solution for interest expense is 2294.48 but cant get it. #include <stdio.h> #include <stdlib.h> #include <math.h> int main () { double P,R,Y,M,X,A,MP,T,I; printf("Enter the Principle:\n"); scanf("%lf",&P); printf("Enter the Rate:\n"); scanf("%lf",&R); printf("Enter the Years:\n"); scanf("%lf",&Y); R = R/1200; M = Y * 12; X=1+R; A=pow(X,M)-1; MP =( R + R / A) * P; T = MP * M; I = R * MP; printf("Monthly Payment is: %.2lf\n",MP); printf("Total Payment is: %.2lf\n",T); printf("Interest Expense is: %lf\n",I); return 0; } [/CODE]

Member Avatar
Member Avatar
+0 forum 1

[CODE]if (option == 3) { { pmt = (percentage * earnings); cout << "pmt is " << pmt << endl; wr = (0.06 / 52.0); cout << "wr is " << wr << endl; n = (52 * actualage); cout << "n is " << n << endl; retirement = pmt * ((1 + wr)n - 1) / wr); cout << "You will have $" << retirement << " saved when you retire." << endl; }[/CODE]

Member Avatar
Member Avatar
+0 forum 1

Hello, I recently took up a challenge to make a full screen pong game in java. So far it is full screen, it does the basics (bouncing off floor/roof/paddles) with a minor point system. I also added support for every 20 seconds it speeds up the ball by 1pixel per 0.05 seconds (50ms is the time I used for an update "delay"), there is also a ball color changer that changes the ball's color randomly every 2 seconds after the 1 minute mark. The 2 mini-challenges have a timer where if one of the 2 paddles misses the ball (aka …

Member Avatar
Member Avatar
+0 forum 2

Hello Guys, firstly i wanna say that this is really great forum. this my first on this forum and hoepfully will not be the last one. okey let me explain what is my problem; on that site [url]http://www.paid-surveys-at-home.com/[/url] i saw this form is created which calcuates "How Much..................." etc.. i really dont want you think i do advertise such site, im totally not realted to them and dont believe in such things. I just want to learn how they created this form. below i gave the code which got from their resource but i really couldnt make it work. What …

Member Avatar
Member Avatar
+0 forum 3

Hello All, I am new to JSP. Currently i am working on jsp project with mysql. I got stucked with jsp date and time which supports mysql datetime format. [I need to do more time calculations in my project.] Please come up with your suggestions. Thanks in Advance. SHANTI.

Member Avatar
Member Avatar
+0 forum 4

The End.