Question: Xcode v9.4.1 - swift Exercise String Equality and Comparison Create two constants, nameInCaps and name. Assign nameInCaps your name as a string literal with proper

Xcode v9.4.1 - swift

Xcode v9.4.1 - swift Exercise String Equality and Comparison Create two constants,nameInCaps and name. Assign nameInCaps your name as a string literal with

Exercise String Equality and Comparison Create two constants, nameInCaps and name. Assign nameInCaps your name as a string literal with proper capitalization. Assign name your name as a string literal in all lowercase. Write an if-else statement that checks to see if nameInCaps and name are the same. If they are, print "The two strings are equal", otherwise print "The two strings are not equal." Write a new if-else statement that also checks to see if nameInCaps and name are the same. However, this time use the lowercased() method on each constant to compare the lowercase version of the strings. If they are equal, print the following statement using string interpolations: KINSERT LOWERCASED VERSION OF nameInCaps HERE> and are the same." If they are not equal, print the following statement using string interpolation: INSERT LOWERCASED VERSION OF nameInCaps HERE> and are not the same." 17 18 Exercise String Equality and Comparison Create two constants, nameInCaps and name. Assign nameInCaps your name as a string literal with proper capitalization. Assign name your name as a string literal in all lowercase. Write an if-else statement that checks to see if nameInCaps and name are the same. If they are, print "The two strings are equal", otherwise print "The two strings are not equal." Write a new if-else statement that also checks to see if nameInCaps and name are the same. However, this time use the lowercased() method on each constant to compare the lowercase version of the strings. If they are equal, print the following statement using string interpolations: KINSERT LOWERCASED VERSION OF nameInCaps HERE> and are the same." If they are not equal, print the following statement using string interpolation: INSERT LOWERCASED VERSION OF nameInCaps HERE> and are not the same." 17 18

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!