Hello Rust Activity

  • Get in groups of 3+ (I only have 16 copies!)

  • Send one person up to get a packet

  • Write your names on the submission sheet (no gradescope issues this time for sure!)

  • Place the lines of code in order in two parts on the page: your shell, and your code file main.rs to make a reasonable sequence and functional code.

  • Wish extra time, add any other commands or lines of rust you might want

  • We'll take the last 5 minutes to share solutions

println!("Good work! Average: {:.1}", average);

cargo run

scores.push(88);

git push -u origin main

let average = total as f64 / scores.len() as f64;

cargo new hello_world

} else if average >= 80.0 {

nano src/main.rs

let total: i32 = scores.iter().sum();

if average >= 90.0 {

touch README.md

cd hello_world

fn main() {

git add src/main.rs

println!("Keep trying! Average: {:.1}", average);

let mut scores = vec![85, 92, 78, 96];

ls -la

echo "This is a grade average calculator" > README.md

} else {

git commit -m "Add calculator functionality"

}}

println!("Excellent! Average: {:.1}", average);