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

Company Valuation is added #1023

Merged
merged 1 commit into from
Jan 12, 2024
Merged
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
65 changes: 65 additions & 0 deletions CompanyValuation/Sumitwarrior7/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.container {
background-color: #fff;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
padding: 20px;
text-align: center;
max-width: 400px;
}

h1 {
color: #007bff;
}

.form {
margin-top: 20px;
}

.form-group {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}

label {
width: 45%;
text-align: left;
}

input {
width: 45%;
padding: 5px;
border: 1px solid #ccc;
border-radius: 5px;
}

button {
background-color: #007bff;
color: white;
border: none;
padding: 10px 20px;
cursor: pointer;
border-radius: 5px;
}

button:hover {
background-color: #0056b3;
}

#result {
margin-top: 20px;
font-weight: bold;
color: #333;
}
39 changes: 39 additions & 0 deletions CompanyValuation/Sumitwarrior7/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="index.css" />
<title>Company Valuation Calculator</title>
</head>
<body>
<div class="container">
<h1>Company Valuation Calculator</h1>
<div class="form">
<div class="form-group">
<label for="companyName">Company Name:</label>
<input type="text" id="companyName" required />
</div>
<div class="form-group">
<label for="teamSize">Team Size:</label>
<input type="number" id="teamSize" required />
</div>
<div class="form-group">
<label for="revenue">Annual Revenue ($):</label>
<input type="number" id="revenue" required />
</div>
<div class="form-group">
<label for="profitMargin">Profit Margin (%):</label>
<input type="number" id="profitMargin" required />
</div>
<div class="form-group">
<label for="growthRate">Growth Rate (%):</label>
<input type="number" id="growthRate" required />
</div>
<button id="calculateBtn">Calculate Valuation</button>
<div id="result"></div>
</div>
</div>
<script src="index.js"></script>
</body>
</html>
33 changes: 33 additions & 0 deletions CompanyValuation/Sumitwarrior7/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
document.addEventListener("DOMContentLoaded", function () {
const calculateBtn = document.getElementById("calculateBtn");
const result = document.getElementById("result");

calculateBtn.addEventListener("click", function () {
const companyName = document.getElementById("companyName").value;
const teamSize = parseInt(document.getElementById("teamSize").value);
const revenue = parseFloat(document.getElementById("revenue").value);
const profitMargin =
parseFloat(document.getElementById("profitMargin").value) / 100;
const growthRate =
parseFloat(document.getElementById("growthRate").value) / 100;

// Input validation
if (
!companyName ||
isNaN(teamSize) ||
isNaN(revenue) ||
isNaN(profitMargin) ||
isNaN(growthRate)
) {
result.innerHTML = "Please enter valid data for all fields.";
return;
}

// Sample company valuation formula (replace with your own model)
const valuation = (revenue * (1 + growthRate)) / (1 - profitMargin);

result.innerHTML = `Company Name: ${companyName}<br>Valuation: $${valuation.toFixed(
2
)}`;
});
});