Welcome Message
Part of the Fundamentals section of Coddy's R journey — lesson 33 of 78.
Challenge
EasyIn this chapter, you'll build a Bill Split Calculator that helps divide restaurant bills among friends.
Display a welcome message for the calculator using cat(). The output should be exactly:
Welcome to the Bill Split Calculator!
Let's split your bill fairly.Make sure each line appears on its own line by embedding the newline character \n inside the string itself, like this:
cat("first line\nsecond line\n")Important: Do not pass \n as a separate argument to cat(). When you write cat("text", "\n"), R inserts a space before the \n, which produces extra spaces in the output and will not match the expected result.
Try it yourself
# TODO: Write your code below
# Use cat() to display the welcome message
# Remember to use \n for new linesAll lessons in Fundamentals
4Operators Part 2
Logical Operators (AND, OR)Logical Operators Part 2 (NOT)Recap - Simple LogicVectorized Logic Part 1Vectorized Logic Part 27Bill Split Calculator
Welcome MessageGetting User Input2Variables and Data Types
Numeric Data TypeInteger Data TypeCharacter Data TypeLogical Data TypeChecking Data TypesNaming ConventionsMissing Values: NARecap - Variable Creation8Loops
For LoopWhile LoopBreakNext (Continue)Recap - FactorialSequence Generation (seq, :)Nested LoopsRecap - Dynamic Input3Operators Part 1
Arithmetic OperatorsInteger Division and ModuloAssignment OperatorsRecap - Simple MathComparison Operators6Basic IO
Print OutputCat for OutputOutput With VariablesReading Input with readline()Type Conversion BasicsRecap - Age CalculatorRecap - True or False9Functions
Declaring a FunctionFunction ArgumentsReturn ValuesRecap - Sigma FunctionRecap - Validation FunctionDefault Parameter Values