Member Avatar

Hi, here I included my code to find no of working days between two years. But in leap year I do not know how to find the working days. Can anyone help me? function calculate($month,$year) { $Start_Date="1/".$month."/".$year.""; $myTime = strtotime($Start_Date); // Use whatever date format you want $daysInMonth = cal_days_in_month(CAL_GREGORIAN, $month, $year); // 31 //$workDays = 0; while($daysInMonth > 0) { $day = date("D", $myTime); // Sun - Sat if($day != "Sun" && $day != "Sat") $workDays++; $daysInMonth--; $myTime += 86400; // 86,400 seconds = 24 hrs. } return $workDays; } <?php echo calculate($MONTH,$YEAR)?>

Member Avatar
+0 forum 4
Member Avatar

Hello i want to calculate three parameters. one X two X three = Y The one is the value of a <input type="number"> the second is default the value '1' and the third is the count of this $sql = "SELECT uid, username, name, profile_pic FROM users"; $result = mysqli_query($db,$sql) or die(mysql_error()); if(mysqli_num_rows($result)) { echo '<ul class="list">'; while($row = mysqli_fetch_array($result)) { $str = strtolower($row['username']); $user_image=$base_url.$upload_path.$row['profile_pic']; echo '<li><a id="'.$row['uid'].'"><img src="'.$user_image.'" /> '.$str.'</a></li>'; } echo "</ul>"; } any help?

Member Avatar
+0 forum 33
Member Avatar

Hello friends. I want to create a countdown program for the new year that is comming. I know i can use this code for example, for short certain time: from threading import Timer def sayhi(): print "hello everybody!" t = Timer(10, sayhi) t.start() But the new year begins in 29 days (2015, march 21)(at 02:15:11 AM). So i cant calculate how many seconds is left!! So what can i do? I think i should give the date to the program and it should use a calendar maybe, but i don't know how.

Member Avatar
+0 forum 13
Member Avatar

I want to copy all the files from one directory to another using the fread() and fwrite()-statements. Some of these files are rather large in size, and that's why I want to calculate who long the transfer will take. (Later I will use this information to show a progress bar containing remaining transfer time, percent data transferred so far and (possibly) the actual transfer speed). **The problem is:** When I try to do a full transfer of the biggest file in the list (the one with index 0 in the fdata-struct) I find that the transfer time is much higher …

Member Avatar
+0 forum 2
Member Avatar

i made union to two mysql tables select cashid, sum(amt) as ramt, NULL AS pamt from receipt where cashid in ('17', '23') GROUP BY cashid union all select cashid, NULL AS ramt, sum(amt) as pamt from payment where cashid in ('17', '23') GROUP BY cashid and now i want to make calculations between them. like-- balance = ramt - pamt can anyone suggest me how can i do that? thanks in advance

Member Avatar
+0 forum 6
Member Avatar

Hi there, I'm a real newbie to python so sorry if this is a stupid question or if I don't fully get your answer, no hate please! I'm trying to write a small program to use when calculating differential equations bu using Euler's step method, don't worry if you don't know what that is, it's not important. My code looks like this: #!/usr/bin/python3.3 -tt import sys def main(): x = float(input("Ange x - värde: ")) y = float(input("Ange y - värde: ")) print ("(",x,",",y,")") h = float(input("Ange steglängd: ")) limit = float(input("Till vilket x - värde önskas gå: ")) while …

Member Avatar
+0 forum 4
Member Avatar

Alright so I'm coding a Quadratic Equation Solver to help with my Math Class. However the teacher requires each calculation to be written out. I have the solver working, however I'm not sure where to start when it comes to printing each step. I know I will need to `System.out.println()` each step. But how does Java interpret the equation? Does it do proper BEDMAS(Brackets, Exponents, Division, Multiplication, Addition, Subtraction)? if(disc == 0) { x1 = (-b+Math.sqrt(Math.pow(b, 2)-4*a*c))/(2*a); System.out.println("One Root Found: " + x1); } else if(disc > 0) { x1 = (-b+Math.sqrt(Math.pow(b, 2)-4*a*c))/(2*a); x2 = (-b-Math.sqrt(Math.pow(b, 2)-4*a*c))/(2*a); //Output Results System.out.println("Two …

Member Avatar
+0 forum 3
Member Avatar

I cannot figure out why my code for calculating student grades makes every number I enter an A. Here is the code. I hope someone can help.

Member Avatar
+0 forum 1
Member Avatar

Good time of day! I'm working on creating an Eulers Method Calculator program. The problem I got stuck on is I don't know how to convert the user's string into a Differential Equation (dy/dx). This is what I have so far: import static java.lang.System.*; import java.util.Scanner; class EulersMethod { public static void main(String args[]) { double xcor, ycor, delx, dely, xcorplusdelx, ycorplusdely, fx; String dydx; Scanner input = new Scanner(System.in); out.print(" Enter x coordinate "); xcor = input.nextDouble(); out.print(" Enter y coordinate "); ycor = input.nextDouble(); out.print(" Enter delta x "); delx = input.nextDouble(); out.print(" Enter dy/dx "); dydx = …

Member Avatar
+0 forum 5
Member Avatar

Hello, I've been trying to create a function to calculate and return the total payment. RadioDay is a radio button with value of 7 while RadioHour is 70. Somehow I am getting InvalidCastException "Conversion from string "" to type 'Integer' is not valid." from the part where I want to convert user inputs from textbox "txtByHour" and "txtByDay" into integer value. Any help is greatly appreciated. Function calcRate() As Integer 'calculate and return total payment for car Dim total, byHour, byDay As Integer byHour = CInt(txtByHour.Text) byDay = CInt(txtByDay.Text) If byHour > 24 Then 'making sure the user does not …

Member Avatar
+0 forum 4
Member Avatar

Hello, i'm new in PHP so i dont know much about it so ill need a little help with this "eazy" problem. I need to calculate the total price of the items on every "checkbox" check. here is my code: <?php $mikrobranova = 3999; $smasina = 4999; $amasina = 9999; $sol = 60; $prasok = 200; $salama = 150; $banani = 80; $vegeta = 100; $zejtin = 70; $paketce = 199; if ($_GET['prasok'] == 'prasok') { echo $prasok; } else if($_GET['salama'] == 'salama') { echo $salama; } else if($_GET['banani'] == 'babani') { echo $banani; } else if($_GET['sol'] == 'sol') { …

Member Avatar
+0 forum 13
Member Avatar

hey guys, so im trying to auto calculate two textfields. like for example i have textfield A and textfield B and also a <span> tag. the span tag is default zero. when user inputs A as 5 the <span> tag becomes 5. then when user inputs B as 2, A and B auto calculate and <span> becomes 7. but its not working for this coding that i have. it doesnt add up instead it becomes 52 instead of 7. i think the hidden input text is in the way but i dont know how to work around that. coding: <html> …

Member Avatar
+0 forum 11
Member Avatar

i stored few values through input form. (for example tax and rate field) if i entered tax = 777.77 and rate = 10000 it stored the details to db successfully. retrieve function also done successfully. but i want to show add these two values(tax+rate = total) from db when i am retrieved these values? i tried few methods. but its not working. how to do that?

Member Avatar
+0 forum 2
Member Avatar

So this is what i need to do and its not coming out right in my code. i need A function to calculate how long the balance will take to grow to a given value. This function is not part of the account class. It should take two arguments: an object of the account class and a target value. It should return how long should pass until the balance on the account object reaches the target value. The account object must be a const reference parameter so that inside the function, you call the function to add interest to the …

Member Avatar
+0 forum 15
Member Avatar

public void kraGridView_RowDataBound(object sender, GridViewRowEventArgs e) int totalPercent = 0; if (e.Row.RowType == DataControlRowType.DataRow) { Label lblWeigh = (Label)e.Row.FindControl("lblWeigh"); // totalPercent += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "lblWeigh")); int total = int.Parse(lblWeigh.Text); totalPercent += total; } else if (e.Row.RowType == DataControlRowType.Footer) { Label lblTotalPercentage = (Label)e.Row.FindControl("lblTotalPercentage"); // e.Row.Cells[5].Text = totalPercent.ToString(); lblTotalPercentage.Text = totalPercent.ToString(); } }

Member Avatar
+0 forum 6
Member Avatar

I have a MySQL database with a table that has a field/column labled "user8" (which is the field for users' state). I have this PHP call and its working fine if I call all states individually and I only want numbers of rows. <?PHP mysql_select_db("freeskat_promail") or die(mysql_error()); $result = mysql_query("SELECT * FROM `users` WHERE `user8` LIKE '%Georgia%' "); $num_rows = mysql_num_rows($result); echo $num_rows - Georgia\n; ?> I would like the MySQL call and the PHP to echo out the lists of all states by percentage. i.e. United States 50% Candana 30% etc. This is what I have so far. <?PHP …

Member Avatar
+0 forum 4
Member Avatar

Hello All! I have a MySQL database with 4 items, id (numerical), group_name, employees, and surveys. I need to in my select calulate the percentage of 'employees' who my the number in 'surveys' have taken the survey. This is the statement I have now: SELECT group_name, employees, surveys, COUNT( surveys ) AS percentage, ((COUNT( * ) / ( SELECT COUNT( * ) FROM db_test)) * 100 ) AS percentage FROM db_test ORDER BY surveys

Member Avatar
+0 forum 1
Member Avatar

I have a question,,, I create 1 form, and in this form I add 5 control checkbox, namely: Checkbox1 = cek1 Checkbox2 = cek2 Checkbox3 = cek3 Checkbox4 = cek4 Checkbox5 = cek5 I want to ask, 1. how to count the number of checkboxes are checked.? 2. how to / code to display cekbox anywhere in check.? for example: if I choose cek1 and cek2, the message "You Choose Cek1 and Cek2" if I choose cek2 and cek3, the message "You Choose Cek2 and Cek3" if I choose cek1 and cek3, the message "You choose cek1 and cek3" and …

Member Avatar
+0 forum 1
Member Avatar

I will show you how to use EasyXLS, a .NET or Java library, as a calculation engine. EasyXLS supports all mathematical operators like arithmetic, logical and unary operators, and a various set of functions as Financial functions, Logical functions, Lookup and Reference functions, Database and List Management functions, Math and Trigonometry functions, Information functions, Statistical functions, Text functions or Date and Time Functions. You may find a full list of supported formulas on chapter Formula Support from this document: [www.easyxls.com/docs/EasyXLS_DetailedSpecificationsSheet.pdf](http://www.easyxls.com/docs/EasyXLS_DetailedSpecificationsSheet.pdf) EasyXLS uses a table to store data. You may fill the table with values and formulas that use those values. …

+0 forum 0
Member Avatar

The attached excel worksheet can explain better of what I need. I need to calculate the attached based on fiscal year starting with August and ending in July for the next 5 years. If you have any other questions for better understanding please let me know.

Member Avatar
+0 forum 18
Member Avatar

I am given the amount of data and the time used. It asks for the time complexity. It is in a Big-O packet Below is the first problem given Algorithm A Data Time 1000 .003 2000 .012 4000 .048 8000 .192 Please explain how to get the time complexity. Thanks!

Member Avatar
+0 forum 7
Member Avatar

So I am trying to write a program that will tell you the lowest grade and the highest grade out of the 3 wthat you put in and also tell you the current average you have in the class. I got the lowest and highest part taken care of but I am having issues with it coming up with the current average you have in the class. It keeps giving me 0 as the average for the student and I can't find the mistake so I was hoping another set of eyes can help me out with this. Here is …

Member Avatar
+0 forum 7
Member Avatar

I have created a form in Adobe Acrobat Pro 9 where I have assigned values to checkboxes. I have managed to sum the total of the checkboxes, which is displayed ina separate textbox, but now I need to calculate the percentage of that against the total. CAn anyone help?

Member Avatar
+0 forum 1
Member Avatar

int NumArray[]="2 ,67 ,23 ,5 ,7 ,34 ,14 ,4 ,8 , 62"; A. display all the value of NumArray with an ODD index B. display all the value in NumArray that are ODD C. calculate and display the average of all EVEN values D. create another array, call it ArrayNum, then store the value of NumArray in reverse order. display the value in ArrayNum. E. display all the index of NumArray whose value is greater than 10. F. count and display the number of ODD and EVEN numbers G. find the MAX and MIN number then calculate and display the …

Member Avatar
+0 forum 3
Member Avatar

Hello again. I am trying to create a simple code that can compute the average of a set of numbers read in using a scanner. import java.util.Scanner; public class Average { public static void main(String[] args) { double number = 0; double total = 0; int count = 0; Scanner scan = new Scanner(System.in); while (number != -1) { System.out.println("Please enter a non negative number."); number = scan.nextDouble(); total = number++; System.out.println("The total is " + total); count++; } double average = total/count; System.out.println("The average is " + average); } } The loop occurs but it won't end. I wanted …

Member Avatar
+0 forum 5
Member Avatar

ok what i am trying to do is i have two textboxs which have figues in them and need the 3rd textbox to display the figure the code i am using doesnt seem to be doing anything could anyone spot it and tell me why it is not working for me my code is [CODE] con.Open() cmd.Connection = con cmd.CommandText = " Val(TQTY.Text) * Val(TUP.Text)" cmd.ExecuteNonQuery() cmd.Dispose()[/CODE]

Member Avatar
+0 forum 2
Member Avatar

these person is hired by her employee which it agree that the salary would be one penny the first day, two pennies the second day and four pennies the third day and continuing to double each day. i have to use a combo box to select the days that the empoyee will be working and calculate the total amount of pay that will received. its not calculating right? Dim intDay As Integer = 0 Dim intCount As Integer = 1 Dim decPay As Decimal = 0 Dim intNumDays As Integer Dim dblTotal As Double = 0 Dim dblTotalPay As Double …

Member Avatar
+0 forum 1
Member Avatar

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
+0 forum 5
Member Avatar

Hi everyone Im new here and not very good with Javascript, so here im asking for a little help for my proyect the problem is Im trying to calculate text fields from results of php query my fields come from the query as amount1, amount2.... what i need is for JS to Sum those fields dynamically, I already did code for when i have all the values and for when the text field name is the same, but never for query results where the names are different this is what i have so far but its not working [CODE]function calculatesumexcon() …

Member Avatar
+0 forum 9
Member Avatar

Hey everyone. I would really appreciate some help. I'm currently building a program in Python 2.6 for an introductory Comp Sci class. The program is supposed to use functions to read a text file from a URL, parse the data into tokens, and use the data to calculate a sort of average 'course grade' for hypothetical students using the URL data. This is all something I've done before, only I didn't use functions. Now that I'm using them, I'm running into errors and need help. Specifically, when I try to run the program I get an error like this: [CODE]Traceback …

Member Avatar
+0 forum 2

The End.