Jump to content

Dtp1337

Members
  • Posts

    30
  • Joined

  • Last visited

Everything posted by Dtp1337

  1. Well I thought I had it... Where am I going wrong.... ughhhh... it is totally different from what he gave me. I don't understand Nesting If and Else efficiently. <?php $Start=$_GET["Start"]; $End=$_GET["End"]; $Increment=$_GET["End"]; if ($Start <=$End && $Increment > 0){ For ($Num1 = $Start; $Num1 <= $End; $Num1 += $Increment) Else { echo "<p><b> ERROR# Your starting integer is less than or equal to the ending integer or the number used is a negative. <b></p>" ; } } if ($Start >= $End && $Increment < 0){ For(Num2 = $Start; $Num2 >= $End; Num2 += $Increment) Else { echo "<p><b> ERROR# Your starting integer is less than or equal to the ending integer or the number used is a negative. <b></p>" ; } } ?>
  2. You guys are really awesome. You know what your doing. Thank you so much for the information. I've burnt through 3 - 4 angles at trying to get the right order for this thing. My brain hurts. I honestly feel like this since starting my programming/network degrees. http://memegenerator.net/instance/23473055 If it's cool for me to continue to post and hang around throughout the semester(and longer) I'd really enjoy getting a better perspective of things.
  3. I spoke to my proffessor today and this is what he gave me. If (Start > End) If(inc<0)Loop what i got ElseError Else [start< 0]If inc>0Loop ElseError He also said I could use an and. (Start>End) and inc < 0 Could you help me beter understand these steps. Please.
  4. Thank you alot for helping. But I still have the problem where I need the increment as you've provided, and as well as with the error message for the starting number being less than the ending integer. I do not understand at-a-boys or girls. But this is how I see what is needed. If Start < End (something about a negative increment?) Start =End =Increment = -1 < how do I get the error apge to show the -1 on increments... due to the start being smaller then the end.Error Message Else If Start > End (something about postive increment)Start =End =Increment = -5 2015105 Do exactly what you provided me, but in increments of 5. which I know is just changing 1 to 5 i think. Others have said something about the algebra changing the increments because of the negatives. Again I am a newb. I'm taking this course to learn, but out of 5 assignments this is the first to stump me. I also appreciate you stopped to take time to help me on a Sunday night. It's not due until Tuesday but I do have a array program to learn and write by thursday if anyone would be open to it when I get this one sorted out. I honestly need a friend to one on one with so I have a spotter to smack my hand with a ruler when I do something wrong then explain to me why. I added what I changed to the file for what I've progressed from your help. The If statement is needed from what I'm aware of, as well as, an Else and another If. Sorry for drama. I just didn't expect a response so fast. If I had known you were on I'd loved to pick your brain to ehance my own. Also apologies for not be very specific. <!DOCTYPE HTML> <?php /********************************************** Author: Dylan T. Patterson* Filname: CISP1720-dpatter3-LAB05.php* Assignment: CISP1720-dpatter3-LAB05.php* Date: 9/19/2012* Description: Displays Annual and Monthly interest of a loan.*********************************************/ ?> <html><head><meta a http-equiv="Content-Type" content="text/html; charset=utf-8"><title> CISP1720 Lab 4</title></head> <h1> Lab 4 </h1><h3> Starting and Ending integers provided.</h3><body><p> <?php $Start=$_GET["Start"]; $End=$_GET["End"]; If (($Start<$End or $Start < 0)){ echo "<p><b> ERROR# Your starting integer is less than or equal to the ending integer or the number used is a negative. <b></p>" ; echo "<p> Start = $Start </p> \n" ; echo "<p> End = $End </p> \n" ; For ($i=$Start; $i>$End; $i = -$i - -1) { echo "<p> Incremented = $i </p> \n" ; } If Else(($Start>$End or $Start > 0)){ echo "<p> Start = $Start </p> \n" ; echo "<p> End = $End </p> \n" ; For ($i=$Start; $i>$End; $i = $i + -5) { echo "<p> Incremented = $i </p> \n" ; } } } ?> </body></html>
  5. This is what I have interpreted. I am having a really hard time with this since I had to take my kid to the doctor and missed a day of class. Could one look over my code and please... PLEASE... ! Help me figure out what I'm doing wrong and correct me so that I can actually SEE my mistakes since I'm totally a fish out of water. Loop and Decision Structure with Form Input 2Purpose:In this lab you will write a php program and input form. The input form will pass information to the php program which will process the data.Procedure:Write an HTML form that will ask the user for a starting and ending integer and an increment. Those values will be passed to a php program. You may use either a GET or POST method to send the data.Write a php program that will accept the data from the form.The program should check that the start value is smaller than the stop value and the increment is positive or that the stop value is smaller than the start value and the increment is negative. If the both of those conditions are false, send an error to the web browser.If a valid condition exists, print the values starting at the start value, ending at the end value in increments of the increment entered.Example:Start 10End 20Increment -1Output error messageStart 20End 0increment -5Output20151050 CISP1720-dpatter3-Lab05-1.php CISP1720-dpatter3-Lab05-F.php
×
×
  • Create New...