Video
Lesson video
See how program structure and named variables make robot information easier to read, change, and explain.
Lesson 2
Students use comments, indentation, naming rules, and variables to build a readable robot profile program.
Video
See how program structure and named variables make robot information easier to read, change, and explain.
Students practice
#include <iostream>
#include <string>
using namespace std;
int main() {
string robotName = "PracticeBot";
int teamNumber = 12345;
double batteryVoltage = 12.6;
int motorCount = 4;
cout << "Robot name: " << robotName << endl;
cout << "Team number: " << teamNumber << endl;
cout << "Battery voltage: " << batteryVoltage << " volts" << endl;
cout << "Motor count: " << motorCount << endl;
return 0;
}