Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kate/rust challenge #14

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/target
/.vscode
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<h1 align="center">100 Days of Rust 🦀 </h1>
<p align="center">
<img width="" src="https://media4.giphy.com/media/RbDKaczqWovIugyJmW/giphy.gif?cid=ecf05e4796b9znwjl0zqxljtzh2xe4yer17y5oojmj5kztep&rid=giphy.gif&ct=g" align="center" alt="gif" />
</p>

# Introduction
Welcome to the 100 Days of Rust Coding Challenge! This challenge is designed to help you learn and improve your Rust programming skills over the course of 100 days.
Expand Down
7 changes: 7 additions & 0 deletions Week-01/Day-01_Convert-Ages-To-Days/challenge1/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Week-01/Day-01_Convert-Ages-To-Days/challenge1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "challenge1"
version = "0.1.0"
edition = "2021"

[dependencies]
14 changes: 14 additions & 0 deletions Week-01/Day-01_Convert-Ages-To-Days/challenge1/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
fn calc_age(age: &u32) -> u32 {
return age * 365;
}

fn main() {

println!("Enter age!");

let mut age = String::new();
std::io::stdin().read_line(&mut age).expect("Issue");
let age: u32 = age.trim().parse().expect("Issue");

println!("Age in days: {}", calc_age(&age));
}