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

Nblar shopping cart easy #1

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
15 changes: 7 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@

- **Open the forked repository**: Navigate to your profile find the repository

`github.com/<your_github_username>/codewithgirlscriptblr`
`github.com/<your_github_username>/code-with-girlscript-bangalore`

- **Clone the repository**: Clone the repository by copying the clone link (find it against the name of the repository on the right). Or using the below CLI command -

`git clone https://github.com/<your-username>/codewithgirlscriptblr`
`git clone https://github.com/<your-username>/code-with-girlscript-bangalore`

- **Create a new branch**: Before you proceed with the project, create a new branch using the following command in the cloned repository:

`git checkout -b <your-branch-name>`

- **Do follow proper naming conventions**: The branch name should be relevant to the problem statement while submitting the solution(refer to the example below)

- **Example**: If you want to create a pull request in the Shopping Cart Problem - Easy, your branch name can be '<your_name>\_ShoppingCartEasy'.
- **Example**: If you want to create a pull request in the Shopping Cart Problem - Easy, your branch name can be `ShoppingCartEasy`.

- **Update the changes to repo**: Add your solution in the new branch. The solution must be in a specified format. Your code should be inside the SOLUTIONS folder of the respective problem statement. The codes/files should be inside a single folder following specific naming convention. The folder name should be your name.
- Root Folder
- Problem Statement
- Solutions
- `<Your solution file>`
- `<Your solution folder>`
- **To add the file(s)** , use the following CLI command

`git add`

- **Commit the file**: For locally cloned repository, use the following CLI command to commit your file.
- **Commit the file(s)**: For locally cloned repository, use the following CLI command to commit your file.

`git commit -m '<your-message>'`

For GitHub web, simply add the commit message and description at the bottom of the page to add the new file.(Please use an appropriate commit message and follow this git commit message guidelines)

- **Create pull request**: For locally cloned repository, `use git push origin <you-branch>`. Please create a Pull Request(PR) from GitHub to the `solutions` branch. If you are new to creating pull requests, watch the video for reference. [Your First GitHub Pull Request (in 10 Mins)](https://www.youtube.com/watch?v=dSl_qnWO104)
- **Create pull request**: For locally cloned repository, use `git push -u origin <you-branch>`. Please create a Pull Request(PR) from GitHub to the `solutions` branch. If you are new to creating pull requests, watch the video for reference. [Your First GitHub Pull Request (in 10 Mins)](https://www.youtube.com/watch?v=dSl_qnWO104)

For GitHub web, simply move over to the original repository and click on New Pull Request and compare forked repositories. Provide appropriate description and VOILA!

Expand All @@ -52,14 +52,13 @@
- [Yati Padia](https://github.com/yati1998)
- [Irshad Ansari](https://github.com/irshadjsr21)

[![](https://sourcerer.io/fame/yajushiSri/girlscript-blr/codewithgirlscriptblr/images/0)](https://sourcerer.io/fame/yajushiSri/girlscript-blr/codewithgirlscriptblr/links/0)[![](https://sourcerer.io/fame/yajushiSri/girlscript-blr/codewithgirlscriptblr/images/1)]

If there are any changes suggested by the reviewers, do make the same and follow to steps to update:

- commit the changes, using command: `git commit -m 'Commit Message'`.
- rebase the branch, using command: `git rebase master`.
- squash the commits, using command: `git stash`.
- push the changes, using command: `git push origin <your-branch-name>`.
- push the changes, using command: `git push -u origin <your-branch-name>`.

The PR with correct and optimised solution, which satisfies the deadline criteria, will be merged soon😄

Expand Down
2 changes: 2 additions & 0 deletions Easy/1. Shopping Cart Problem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ Output will be a bill based on the given input. The bill can be in any format bu

## Requirements for submission

- A document containing a screenshot showing the results must also be pushed along with final submission. A brief description(not more than 4-5 lines/100 words) should be included containing the approach used for solving the problem.
- Last Submission Date : `30th July 2020`
- If you haven’t filled our [participation form](https://tinyurl.com/codewithgsblr) 📃yet, fill it now.

## How to submit solution?

Expand Down
Binary file not shown.
102 changes: 102 additions & 0 deletions Easy/1. Shopping Cart Problem/solutions/nblar/Opensource.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@

package opensource;

import java.util.HashMap;
import java.util.Scanner;

/**
*
* @author nblar
*/
public class Opensource {

static double sum=0; static String name,phoneNo,payment;
static HashMap<Integer,Integer> menu=new HashMap<Integer,Integer>();

public static void main(String[] args) {

System.out.println("Welcome to GadgetifyWithGSBlr\nElectronics at your footseps! "+"\nPress 1 to see menu");

Scanner sc=new Scanner(System.in);
int ch=sc.nextInt();
if(ch==1) shopping_list();
System.out.println("Press 7 to enter things you want to want to purchase\nPress 8 to see the purchase list\nPress 9 for the bill");

ch=sc.nextInt();

if(ch==7) choice();
else if(ch==8) shopping_list();
else if(ch==9) System.out.println("Sorry! You need to buy something first, to get the bill. Try Again!");
else System.out.println("Wrong Choice. Come Again!");

}

private static void shopping_list() {
System.out.println("The Items Avavlible in the store are");
System.out.println("-------------------------------------");
System.out.println("1.Basshead earphones: Rs. 1200\n" +
"2.Bluetooth computer mouse: Rs. 600\n"+"3.Mobile Charger: Rs.500\n"+"4.Wireless Keyboard: Rs 1500\n"+"5.Wireless Earphones: Rs.1200\n");
menu.put(1,1200);
menu.put(2,600);
menu.put(3,500);
menu.put(4,1500);
menu.put(5,1200);
}

private static void choice() {
// System.out.println("Press 7 to enter things you want to want to purchase\nPress 8 to see the purchase list\nPress 9 for the bill");
Scanner sc=new Scanner(System.in);


while(true){

System.out.println("State the index of your Purchase");
int index=sc.nextInt();
System.out.println("State the quantity");
int quant=sc.nextInt();
bill(index,quant);
System.out.println("Press 9 get the bill\nPress 8 to see the shopping list again\nPress 0 to continue");
int ch=sc.nextInt();
switch(ch){
case 9: display_bill(); break;
case 8: shopping_list();break;
case 0:
}

}

//System.out.println("Use the format:- (index of your product),quantity");
}

private static void bill(int index, int quant) {
sum+=(menu.get(index)*quant);
}

private static void display_bill() {
System.out.println("Enter Your Name");
Scanner sc=new Scanner(System.in);
name=sc.next();
System.out.println("Enter Your Phone Number");
phoneNo=sc.next();
System.out.println("Enter the payment mode (Cash/Card/Online)");
payment=sc.next();

System.out.println("Thanks you For Shopping at GadgetifyWithGSBlr\n Your bill for the shopping is as follows");
for (int i = 0; i < 10000; i++);

System.out.println("-------------- BILL -------------------");
System.out.println("Shop name:- GadgetifyWithGSBlr");
System.out.println("Shop address: 311/5 Akshay nagar, Bangalore, Karnataka, India");
System.out.println("Shop contact no: +91 9988776655");
System.out.println("Customer Details are --------------");
System.out.println("Name:- "+name+"\nPhone Number:- "+phoneNo);
sum=sum+(0.06*sum);
System.out.println("Total Amount of purchase is:- "+sum);
System.out.println("Payemnt Mode:- "+payment);
girlscript-blr marked this conversation as resolved.
Show resolved Hide resolved
System.out.println("Thanks For Your Visit. See You soon \n---------------------------");
System.exit(0);


}

}
36 changes: 0 additions & 36 deletions Easy/2. Puzzle Problem/README.md

This file was deleted.

1 change: 0 additions & 1 deletion Easy/2. Puzzle Problem/solutions/README.md

This file was deleted.

1 change: 0 additions & 1 deletion Easy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
### Table of Content

- [1. Shopping Cart Problem](1.%20Shopping%20Cart%20Problem/README.md)
- [2. Puzzle Problem](2.%20Puzzle%20Problem/README.md)
2 changes: 2 additions & 0 deletions Hard/1. Shopping Cart Problem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ Input & output can be in any format or variation but it must include the followi

## Requirements for submission

- A document containing a screenshot showing the results must also be pushed along with final submission. A brief description(not more than 4-5 lines/100 words) should be included containing the approach used for solving the problem.
- Last Submission Date : `30th July 2020`
- If you haven’t filled our [participation form](https://tinyurl.com/codewithgsblr) 📃yet, fill it now.

## How to submit solution?

Expand Down
36 changes: 0 additions & 36 deletions Hard/2. Puzzle Problem/README.md

This file was deleted.

1 change: 0 additions & 1 deletion Hard/2. Puzzle Problem/solutions/README.md

This file was deleted.

1 change: 0 additions & 1 deletion Hard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
### Table of Content

- [1. Shopping Cart Problem](1.%20Shopping%20Cart%20Problem/README.md)
- [2. Puzzle Problem](2.%20Puzzle%20Problem/README.md)
2 changes: 2 additions & 0 deletions Medium/1. Shopping Cart Problem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ Output will be a bill based on the given input. The bill can be in any format bu

## Requirements for submission

- A document containing a screenshot showing the results must also be pushed along with final submission. A brief description(not more than 4-5 lines/100 words) should be included containing the approach used for solving the problem.
- Last Submission Date : `30th July 2020`
- If you haven’t filled our [participation form](https://tinyurl.com/codewithgsblr) 📃yet, fill it now.

## How to submit solution?

Expand Down
41 changes: 0 additions & 41 deletions Medium/2. Puzzle Problem/README.md

This file was deleted.

1 change: 0 additions & 1 deletion Medium/2. Puzzle Problem/solutions/README.md

This file was deleted.

1 change: 0 additions & 1 deletion Medium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
### Table of Content

- [1. Shopping Cart Problem](1.%20Shopping%20Cart%20Problem/README.md)
- [2. Puzzle Problem](2.%20Puzzle%20Problem/README.md)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ If you are starting your journey in Free and Open Source Software Development, t

We have a range of problem statements for beginner, intermediate, and advanced levels for you to solve 📝. The problem statements are independent of any technology stacks, so you can focus on the underlying concepts.

Participants are free to use any programming language of their choice. The solution would earn contributors their badge as **THE NEOPHYTE** 🥉 on completing beginner level problem. We also have the **THE EXPLORER** 🥈 and **THE AFICIONADO** 🥇 badges on completion of the intermediate and advanced levels respectively. If your pull requests in all levels get merged, at least a week before the deadline, you can earn your exclusive **GEEK OF THE GEEKS** 🏆 special recognition badge every month!🎉🎉
> Participants are free to use any programming language of their choice. The solution would earn contributors their badge as **THE NEOPHYTE** 🥉 on completing beginner level problem. We also have the **THE EXPLORER** 🥈 and **THE AFICIONADO** 🥇 badges on completion of the intermediate and advanced levels respectively. If your pull requests in all levels get merged, at least a week before the deadline, you can earn your exclusive **GEEK OF THE GEEKS** 🏆 special recognition badge every month!🎉🎉

🎁🏅 These E-badges will be rewarded on completion of each level. You will also get rewarded with a bonus badge on early completion of each level! We will be using the Badgr platform for distributing Open Badges. Grab your badges by making your contribution.😃
> 🎁🏅 These E-badges will be rewarded on completion of each level. You will also get rewarded with a bonus badge on early completion of each level! We will be using the Badgr platform for distributing Open Badges. Grab your badges by making your contribution.😃

Don’t forget to fill the [participation form](https://tinyurl.com/codewithgsblr) 📃 to take part in the program, if not already done.

Expand Down
Binary file modified assets/images/pr_compare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.