Browse Source

docs(tuples): correct grammar

DEV-3198-new-go-exercise-get-digit-len
davhojt 2 years ago committed by Dav Hojt
parent
commit
2217b13a6a
  1. 43
      subjects/tuples/README.md

43
subjects/tuples/README.md

@ -2,32 +2,10 @@
### Instructions
- Define a tuple structure to represent a `Student`.
- Each student is identified by an id number of type i32, his/her name and his/her last name of type string.
- Define a tuple `struct` to represent a `Student`. Each is identified by an id of type `i32`, their first name and last name.
- Then define three **functions** to return the id, first name and last name.
### Notions
- [Defining a struct](https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html)
- [The Tuple Type](https://doc.rust-lang.org/stable/book/ch03-02-data-types.html?highlight=accessing%20a%20tuple#compound-types)
- [Tuples](https://doc.rust-lang.org/rust-by-example/primitives/tuples.html)
- [Tuple Structs without Named Fields](https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html?highlight=tuple#using-tuple-structs-without-named-fields-to-create-different-types)
- [Adding Useful Functionality with Derived Traits](https://doc.rust-lang.org/stable/book/ch05-02-example-structs.html?highlight=debug%20deriv#adding-useful-functionality-with-derived-traits)
- [Chapter 7](https://doc.rust-lang.org/stable/book/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html)
### Dependencies
meval = "0.2"
### Expected Functions
```rust
pub fn id(student: &Student) -> i32 {
}
@ -39,6 +17,11 @@ pub fn last_name(student: &Student) -> String {
}
```
### Dependencies
meval = "0.2"
### Usage
Here is a program to test your functions
@ -65,3 +48,17 @@ Student last name: Domingos
Student Id: 20
$
```
### Notions
- [Defining a struct](https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html)
- [The Tuple Type](https://doc.rust-lang.org/stable/book/ch03-02-data-types.html?highlight=accessing%20a%20tuple#compound-types)
- [Tuples](https://doc.rust-lang.org/rust-by-example/primitives/tuples.html)
- [Tuple Structs without Named Fields](https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html?highlight=tuple#using-tuple-structs-without-named-fields-to-create-different-types)
- [Adding Useful Functionality with Derived Traits](https://doc.rust-lang.org/stable/book/ch05-02-example-structs.html?highlight=debug%20deriv#adding-useful-functionality-with-derived-traits)
- [Chapter 7](https://doc.rust-lang.org/stable/book/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html)

Loading…
Cancel
Save