Skip to content

Commit

Permalink
Dynamic input, functions, functions with different structures like co…
Browse files Browse the repository at this point in the history
…nditional and iterative.
  • Loading branch information
faheemuzzaman committed Oct 13, 2019
1 parent fae4145 commit 2a08034
Show file tree
Hide file tree
Showing 29 changed files with 164 additions and 0 deletions.
6 changes: 6 additions & 0 deletions class03/Cargo.lock

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

9 changes: 9 additions & 0 deletions class03/Cargo.toml
@@ -0,0 +1,9 @@
[package]
name = "class03"
version = "0.1.0"
authors = ["Admin <faheemuzzaman@hotmail.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
132 changes: 132 additions & 0 deletions class03/src/main.rs
@@ -0,0 +1,132 @@
// fn main() {
// println!("The Sum is: {}", add_two_number(45, 30)); // Function Calling

// println!("The Square is: {}", square(25));

// hello_world();

// print_name("Faheem".to_string());
// println!("The Square is: {}",calculate_square());

// let mut input_01 = String::new();
// io::stdin().read_line(&mut input_01);
// let input_01:i32 = input_01.trim().parse().unwrap();
// let mut input_02 = String::new();
// io::stdin().read_line(&mut input_02);
// let input_02:i32 = input_02.trim().parse().unwrap();

// println!("The greater input number is {}", check_maxV2(input_01, input_02));

// let cal_result = arthimatic_operations(input_01, input_02);
// println!("The Sum is: {}",cal_result.0);
// println!("The Sub is: {}",cal_result.1);
// println!("The Mul is: {}",cal_result.2);
// println!("The Div is: {}",cal_result.3);

// let cal_sq_cb = square_and_cube(input_01);
// println!("The number {} square is {} and cube is {}",
// input_01,cal_sq_cb.0,cal_sq_cb.1);

// let arrNum = [345,567,678,234,456,23];
// println!("The Max Number Is {}",largest(&arrNum));

// let arrNum02 = [345,567,6783,234,456,23];
// println!("The Max Number Is {}",largest(&arrNum02));

// }

// // this function taking the two interger parameter and return the sum of the two numbers.
// // // addTwoNumber function Name
// // // (x:i32,y:i32) Function Paramerters
// // // ->i32 indicates Return Type
// // // sum
// // // Function Decalartion

// fn add_two_number(x:i32,y:i32)->i32{
// let sum:i32;
// sum = x+y;
// sum
// }

// // this function get the input parameter as integer and return the square of given number.
// fn square(x:i32)->i32{
// x*x
// }
// // this function just print the single line statement.
// fn hello_world(){
// println!("Hello World");
// }

// // this function take one parameter as string and print it.
// fn print_name(name:String){
// println!("The name is: {}",name);
// }

// // this function calculate the square on behalf of user dynamic input.
// use std::io;
// fn calculate_square()->i32{
// let mut input = String::new();
// io::stdin().read_line(&mut input);
// let input:i32 = input.trim().parse().unwrap();
// input*input
// }

// // this function takes two input parameters and check which one is the largerst and print the larger one.
// fn check_max(x:i32,y:i32)->String{
// if x>y{
// "The number 01 input is greater".to_string()
// }
// else{
// "The number 02 input is greater".to_string()
// }
// }
// // this function takes two input parameters and check which one is the largerst and return the larger one.
// fn check_maxV2(x:i32,y:i32)->i32{
// if x>y{
// x
// }
// else{
// y
// }
// }

// // this function take the first name and last name using the dynamic input from the user
// // and return the tuple as first name and lastname.
// fn take_full_name()->(String,String){

// println!("Enter First Name");
// let mut input_01 = String::new();
// io::stdin().read_line(&mut input_01);
// let input_01 = input_01.trim().to_string();

// println!("Enter Last Name");
// let mut input_02 = String::new();
// io::stdin().read_line(&mut input_02);
// let input_02 = input_02.trim().to_string();

// (input_01,input_02) // return the tuple
// }

// // this function take one integer input (i32) and return the all mathematical operation addition, subtraction,
// // multiplication and division.
// fn arthimatic_operations(x:i32,y:i32)->(i32,i32,i32,i32){
// (x+y,x-y,x*y,x/y)
// }

// // this function take one integer input (i32) and return the square and cube in the form of tuple
// fn square_and_cube(x:i32)->(i32,i32){
// (x*x,x*x*x)
// }

// // this function take input as integer (i32) array and return the largest value in array.
// fn largest(arrNum:&[i32])->i32{

// let mut max = arrNum[0];
// for x in (1..arrNum.len())
// {
// if max < arrNum[x]{
// max = arrNum[x];
// }
// }
// max
// }
1 change: 1 addition & 0 deletions class03/target/.rustc_info.json
@@ -0,0 +1 @@
{"rustc_fingerprint":9484594007537757877,"outputs":{"1164083562126845933":["rustc 1.37.0 (eae3437df 2019-08-13)\nbinary: rustc\ncommit-hash: eae3437dfe991621e8afdc82734f4a172d7ddf9b\ncommit-date: 2019-08-13\nhost: x86_64-pc-windows-msvc\nrelease: 1.37.0\nLLVM version: 8.0\n",""],"4476964694761187371":["___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Admin\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n",""],"9311443727202421799":["___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Admin\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n",""]},"successes":{}}
Empty file.
Binary file not shown.
@@ -0,0 +1 @@
This file has an mtime of when this was started.
@@ -0,0 +1 @@
26f5ecb1d31495f8
@@ -0,0 +1 @@
{"rustc":16761476351873615079,"features":"[]","target":12670212195296036023,"profile":1647870076477133176,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":".fingerprint\\class03-33ee0b8e2073046f\\dep-test-bin-class03-33ee0b8e2073046f"}}],"rustflags":[],"metadata":11626969923688510520}
@@ -0,0 +1 @@
40cf6f1ba1dadff6
@@ -0,0 +1 @@
{"rustc":16761476351873615079,"features":"[]","target":12670212195296036023,"profile":14891217944882224483,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":".fingerprint\\class03-3e772c76143c3042\\dep-bin-class03-3e772c76143c3042"}}],"rustflags":[],"metadata":11626969923688510520}
Binary file not shown.
@@ -0,0 +1 @@
This file has an mtime of when this was started.
5 changes: 5 additions & 0 deletions class03/target/debug/deps/class03-33ee0b8e2073046f.d
@@ -0,0 +1,5 @@
c:\Users\Admin\Desktop\Rust\class03\target\debug\deps\class03-33ee0b8e2073046f.rmeta: src\main.rs

c:\Users\Admin\Desktop\Rust\class03\target\debug\deps\class03-33ee0b8e2073046f.d: src\main.rs

src\main.rs:
5 changes: 5 additions & 0 deletions class03/target/debug/deps/class03-3e772c76143c3042.d
@@ -0,0 +1,5 @@
c:\Users\Admin\Desktop\Rust\class03\target\debug\deps\class03-3e772c76143c3042.rmeta: src\main.rs

c:\Users\Admin\Desktop\Rust\class03\target\debug\deps\class03-3e772c76143c3042.d: src\main.rs

src\main.rs:
Empty file.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.

0 comments on commit 2a08034

Please sign in to comment.