Pure Programmer
Blue Matrix


Cluster Map

Project: I Love My Town (Revisited)

Write a program that prints the message "I 💜 YourHomeTown!" followed by the message "I 💔 SomeOtherTown!" Assign each town and the emojis into their own variables. Then use string concatenation to form the two messages and store them in variables as well. Then print out the message variables.

Broken Heart Emoji: U+1F494
Purple Heart Emoji: U+1F49C

Output
$ rustc ILoveMyTown2.rs warning: static variable `loveTown` should have an upper case name --> ILoveMyTown2.rs:7:8 | 7 | static loveTown:&str = "Saint Louis"; | ^^^^^^^^ help: convert the identifier to upper case: `LOVE_TOWN` | = note: `#[warn(non_upper_case_globals)]` on by default warning: static variable `hateTown` should have an upper case name --> ILoveMyTown2.rs:8:8 | 8 | static hateTown:&str = "East Saint Louis"; | ^^^^^^^^ help: convert the identifier to upper case: `HATE_TOWN` warning: static variable `heart` should have an upper case name --> ILoveMyTown2.rs:9:8 | 9 | static heart:&str = "\u{1F494}"; | ^^^^^ help: convert the identifier to upper case: `HEART` warning: static variable `brokenHeart` should have an upper case name --> ILoveMyTown2.rs:10:8 | 10 | static brokenHeart:&str = "\u{1F49C}"; | ^^^^^^^^^^^ help: convert the identifier to upper case: `BROKEN_HEART` warning: 4 warnings emitted $ ./ILoveMyTown2 I 💔 Saint Louis! I 💜 East Saint Louis!

Solution