Pure Programmer
Blue Matrix


Cluster Map

Project: License Plate Generator

Assume that you work for the Department of Motor Vehicles. Write a program that generates all the possible license plate numbers and then prints the total number of plates at the very end.

Start with license plate numbers that are composed of three alphabetic (capital) letters, a dash then three digits. Don't allow 'I', 'O' and 'S' letters because they can be confused with digits. Modify the program to match the pattern that your state uses. See [[License Plate Designs]].

Output
$ rustc LicensePlates1.rs error: unknown format trait `c` --> LicensePlates1.rs:18:35 | 18 | ... println!("{}", format!("{0:c}{1:c}{2:c}-{3:c}{4:c}{5:c}", c1, c2, c3, c4, c5, c6)); | ^ | = note: the only appropriate formatting traits are: - ``, which uses the `Display` trait - `?`, which uses the `Debug` trait - `e`, which uses the `LowerExp` trait - `E`, which uses the `UpperExp` trait - `o`, which uses the `Octal` trait - `p`, which uses the `Pointer` trait - `b`, which uses the `Binary` trait - `x`, which uses the `LowerHex` trait - `X`, which uses the `UpperHex` trait error: unknown format trait `c` --> LicensePlates1.rs:18:40 | 18 | ... println!("{}", format!("{0:c}{1:c}{2:c}-{3:c}{4:c}{5:c}", c1, c2, c3, c4, c5, c6)); | ^ | = note: the only appropriate formatting traits are: - ``, which uses the `Display` trait - `?`, which uses the `Debug` trait - `e`, which uses the `LowerExp` trait - `E`, which uses the `UpperExp` trait - `o`, which uses the `Octal` trait - `p`, which uses the `Pointer` trait - `b`, which uses the `Binary` trait - `x`, which uses the `LowerHex` trait - `X`, which uses the `UpperHex` trait error: unknown format trait `c` --> LicensePlates1.rs:18:45 | 18 | ... println!("{}", format!("{0:c}{1:c}{2:c}-{3:c}{4:c}{5:c}", c1, c2, c3, c4, c5, c6)); | ^ | = note: the only appropriate formatting traits are: - ``, which uses the `Display` trait - `?`, which uses the `Debug` trait - `e`, which uses the `LowerExp` trait - `E`, which uses the `UpperExp` trait - `o`, which uses the `Octal` trait - `p`, which uses the `Pointer` trait - `b`, which uses the `Binary` trait - `x`, which uses the `LowerHex` trait - `X`, which uses the `UpperHex` trait error: unknown format trait `c` --> LicensePlates1.rs:18:51 | 18 | ... println!("{}", format!("{0:c}{1:c}{2:c}-{3:c}{4:c}{5:c}", c1, c2, c3, c4, c5, c6)); | ^ | = note: the only appropriate formatting traits are: - ``, which uses the `Display` trait - `?`, which uses the `Debug` trait - `e`, which uses the `LowerExp` trait - `E`, which uses the `UpperExp` trait - `o`, which uses the `Octal` trait - `p`, which uses the `Pointer` trait - `b`, which uses the `Binary` trait - `x`, which uses the `LowerHex` trait - `X`, which uses the `UpperHex` trait error: unknown format trait `c` --> LicensePlates1.rs:18:56 | 18 | ... println!("{}", format!("{0:c}{1:c}{2:c}-{3:c}{4:c}{5:c}", c1, c2, c3, c4, c5, c6)); | ^ | = note: the only appropriate formatting traits are: - ``, which uses the `Display` trait - `?`, which uses the `Debug` trait - `e`, which uses the `LowerExp` trait - `E`, which uses the `UpperExp` trait - `o`, which uses the `Octal` trait - `p`, which uses the `Pointer` trait - `b`, which uses the `Binary` trait - `x`, which uses the `LowerHex` trait - `X`, which uses the `UpperHex` trait error: unknown format trait `c` --> LicensePlates1.rs:18:61 | 18 | ... println!("{}", format!("{0:c}{1:c}{2:c}-{3:c}{4:c}{5:c}", c1, c2, c3, c4, c5, c6)); | ^ | = note: the only appropriate formatting traits are: - ``, which uses the `Display` trait - `?`, which uses the `Debug` trait - `e`, which uses the `LowerExp` trait - `E`, which uses the `UpperExp` trait - `o`, which uses the `Octal` trait - `p`, which uses the `Pointer` trait - `b`, which uses the `Binary` trait - `x`, which uses the `LowerHex` trait - `X`, which uses the `UpperHex` trait error: aborting due to 6 previous errors

Solution