now that you know how to set variables, concatenate strings, perform basic arithmetic and write information for the user to see, you should have no difficulty creating a few simple programs with that knowledge.
don't forget to add comments describing what's happening in your programs. you should do that in all your assignments from here on but it's particularly important now that you've just seen php comments for the first time.
write a program where you set each line of a song to a variable then join them together before writing them to the screen.
don't forget to add line breaks between the lines of the song. this can be either \n or <br>, depending on whether you want the output to show up properly in the source code in the browser or the browser window itself.
the result should look something like this...
Jump (Blackpink)
I'm not that easy to tame
You should see me under these lights, all my tears turn to ice
That's the sweetest escape
Every time the feeling kicks in, I might stay through the night
[...]
you should add the title and group as well as multiple line breaks between verses to make it readable.
you can use whatever you like as names for the variables but $line1, $line2, etc might be easiest.
write a program to calculate a total from a series of items.
go to an online shopping site of your choice and pick a dozen items to purchase.
add the name and price of each to variables.
print each item with its price as a list.
calculate the subtotal, tax and total, printing each with its appropriate label.
it should look something like this...
t-shirt $24.90
hoodie $46.24
jeans $80.75
belt $26.05
subtotal $177.94
tax $26.69
total $204.63
don't worry about making sure the numbers are rounded properly. we'll deal with that later. this is just about doing basic math.
write a program to calculate the volumes of several geometric solids, given their measurements. pick at least three to work with. you can choose any you like but a cube, a rectangular prism and a cylinder might be a good place to start.
if you need pi in your calculation, you can either use an estimate like 3.14159 or M_PI, a built-in constant set to the first 14 digits of pi.
it should look something like this...
volume of a cylinder
height 15
radius 4
volume 376.99
you can add units if you like (cm and cm^3, for example) but it doesn't matter for the exercise.