Current time: 18 Apr 2024, 10:01 PM



Need help with homework
Offline Master

Registered User
Registered
11 Years of Service
Posts: 225
Threads: 124
Likes Received: 0 in 0 posts
Likes Given: 0
Joined: Feb 2013
Reputation: 0
Bronze Medal
#1
Need help with homework

Hello i am having trouble understanding the question I'm confused its for PHP, am i supposed to list Celsius to Fahrenheit as well, and if so do i need a "do while statement"  i also have the code for the Celsius but how do i listed

You will use an appropriate looping statement to write a script that
displays a list of the Celsius equivalents of zero degrees Fahrenheit
through 100 degrees Fahrenheit. To convert Fahrenheit to Celsius,
subtract 32 from the Fahrenheit temperature, and then multiply
the remainder by (5/9). To convert Celsius to Fahrenheit, multiply
the Celsius temperature by (9/5), and then add 32. Use the round()
function you learned in Chapter 1 to display the Celsius temperature
to one place after the decimal point.



this is what i have

<?php


    $FahrenheitTemp = 0;

       while ($FahrenheitTemp <= 100)

       {
            $CelsiusTemp = ($FahrenheitTemp - (32 * 5/9));

            echo $FahrenheitTemp." Fahrenheit is equal to   ".round($CelsiusTemp)." Celsius<br />";
             $FahrenheitTemp++;

       }


?>


this is some of the result 

0 Fahrenheit is equal to -18 Celsius

1 Fahrenheit is equal to -17 Celsius
2 Fahrenheit is equal to -16 Celsius
3 Fahrenheit is equal to -15 Celsius
4 Fahrenheit is equal to -14 Celsius
s


04 Feb 2018, 01:46 AM
Find
Away SmG FlasH™

Senior Member
Senior Member
******
10 Years of Service
Posts: 3,129
Threads: 102
Likes Received: 0 in 0 posts
Likes Given: 0
Joined: Apr 2013
Reputation: 141
Location: Summoners Rift
Halo GodCrystal DonatorSmoothThe BombDiscord WarriorGavel of Trinity
DiamondGamerProgrammerThanks From Cloud
#2
RE: Need help with homework

To my understanding even though the formula for Celsius to Fahrenheit is given, the question still asks you to display the appropriate Celsius values for Fahrenheit values from 0 to 100. What you've done seems fine.
[Image: SPOILER_FlasH-1.gif]
04 Feb 2018, 03:29 PM
Find
Offline Cyrusthemuffinman

Registered User
Registered
5 Years of Service
Posts: 11
Threads: 1
Likes Received: 0 in 0 posts
Likes Given: 0
Joined: Jun 2018
Reputation: 0
Location: Oregon
Discord: Heinrich Himmler#8014
#3
RE: Need help with homework

(04 Feb 2018, 01:46 AM)Master Wrote: Hello i am having trouble understanding the question I'm confused its for PHP, am i supposed to list Celsius to Fahrenheit as well, and if so do i need a "do while statement"  i also have the code for the Celsius but how do i listed

You will use an appropriate looping statement to write a script that
displays a list of the Celsius equivalents of zero degrees Fahrenheit
through 100 degrees Fahrenheit. To convert Fahrenheit to Celsius,
subtract 32 from the Fahrenheit temperature, and then multiply
the remainder by (5/9). To convert Celsius to Fahrenheit, multiply
the Celsius temperature by (9/5), and then add 32. Use the round()
function you learned in Chapter 1 to display the Celsius temperature
to one place after the decimal point.



this is what i have

<?php


    $FahrenheitTemp = 0;

       while ($FahrenheitTemp <= 100)

       {
            $CelsiusTemp = ($FahrenheitTemp - (32 * 5/9));

            echo $FahrenheitTemp." Fahrenheit is equal to   ".round($CelsiusTemp)." Celsius<br />";
             $FahrenheitTemp++;

       }


?>


this is some of the result 

0 Fahrenheit is equal to -18 Celsius

1 Fahrenheit is equal to -17 Celsius
2 Fahrenheit is equal to -16 Celsius
3 Fahrenheit is equal to -15 Celsius
4 Fahrenheit is equal to -14 Celsius
Shnnnm 
03 Jun 2018, 03:17 PM
Find
Offline SmG UreshiiShiro

嬉しいShiro
Senior Member
******
6 Years of Service
Posts: 578
Threads: 22
Likes Received: 0 in 0 posts
Likes Given: 0
Joined: Mar 2018
Reputation: 121
Location: Poland
Discord: Ure#3988
FortniterScoutEmerald DonatorDonatorCrystal DonatorBronze Medal
Discord WarriorGamerPet LoverSupporter
#4
RE: Need help with homework

Try check out this in google xD

[Image: E72GbKE.png]

03 Jun 2018, 03:23 PM
Website Find
Offline SmG Zemox

Boop Master
Senior Member
******
7 Years of Service
Posts: 752
Threads: 45
Likes Received: 0 in 0 posts
Likes Given: 0
Joined: Feb 2017
Reputation: 126
Discord: Alystia#9536
Emerald DonatorThanks From CloudDiscord WarriorScoutGatekeeperDiscord Master
Bronze MedalCoolThe BombHand-held/Mobile GamerGamerHalloween
Silver MedalSmoothHalo GodChristmas 2018Bronze MedalValentines Day Ruby
DiamondPet Lover
#5
RE: Need help with homework

Please don't necro post on inactive threads <3
thanks
@Cyrusthemuffinman
@"Mine"

/locked
[img=0x0]https://lh3.googleusercontent.com/oY0bk0AemBkUJo4seqa2tI7KIuRLA0lWMW8pbMnPcs7etWLirUpKiMX-Mha0tyzkhUEVrk4_KtJmVADscwiWqJ-fOydDNTY69li-mtVlkarT3M4fG0aQUs32udVR4qb3h7a9be22GYHWrP4IuaaJucs-etT8Ht9fkw5rHQcS927vJiue5jgesEkcTmTvJBvbmaiQ9Ou9y8tqrrWL3ycn4Ew7woe4_mtUU4bXTvXekQN-on5dH3gpiHgV1t9gUPe7g1VazSuQ1EjEEQMez-yQt__h1Vi2szEu22uKlbMBbKJY08-sAIF5YSzq6-a1LhRwNg_XIL3xVu_97o2Epagdp4M4JwGaigxMnUf02se6ISzy8glnLGWou9qOIR28YZ3YTha6dzxNS3kkVldreVusGgeJ3LGbl0LfeGR1PZGUsLYKNSgfdPv-2PAzogEhnujrT1aoAtCsflh4wcWbkEk3pX0b581PJJhUqqH1MoBxFbn6jyc6bU8J8McVPcrEtSSjQwmbNznVjXumeACPXJFsQnt2rPupbZrtx-8Z8Cy5IaG-e8RoQK4ltgDIewSAR5dnRizVHqn1lip2WmR8vxjZ4wcWMFMMD2KsqSMzuGs=w1442-h515-no[/img]
“Strange how there’s always a little more innocence left to lose.”
03 Jun 2018, 04:52 PM
Find


Forum Jump:


Users browsing this thread: 1 Guest(s)
SmG Gaming, © 2010-2024
Theme By: «SmG» Cloud
Edited by: «SmG» Wires