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

Question one and four updated for better #2

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 8 additions & 2 deletions algorithms/challenge-1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
//Implement a function secondLargest(arr) that takes an array of numbers and returns the second largest number.
function secondLargest(arr) {


const sortedArray = arr.sort((a, b) => (a - b));
let secondLargestNum = sortedArray[sortedArray.length - 2];

console.log(secondLargestNum);
return secondLargestNum;
}
module.exports = secondLargest
module.exports = secondLargest;
15 changes: 12 additions & 3 deletions algorithms/challenge-2.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
//Implement a function filterArray(arr) that takes an array of non-negative integers and strings and return a new array without the strings.
function filterArray(arr) {

}
let returnValue = [];

for (let i = 0; i < arr.length; i++) {
if (typeof arr[i] == "number") {
returnValue.push(arr[i]);
}
}

module.exports = filterArray
console.log(returnValue);
return returnValue;
}
module.exports = filterArray;
15 changes: 11 additions & 4 deletions algorithms/challenge-3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
//Implement the function sumMix(arr) that given an array of integers as strings and numbers, returns the sum of the array values as if all were numbers.
function sumMix(arr) {

}

module.exports = sumMix
let returnValue = 0;
for (let i = 0; i < arr.length; i++) {
if (+arr[i]) {
returnValue += Number(arr[i]);
}
}
console.log(returnValue);
return returnValue;
}
module.exports = sumMix;
19 changes: 15 additions & 4 deletions algorithms/challenge-4.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
//Implement the function sumTwoSmallestNums(arr) that takes an array of numbers and returns the sum of the two lowest positive numbers.
function sumTwoSmallestNums(arr) {


}
module.exports =sumTwoSmallestNums
const sortedArray = arr.sort((a, b) => (a - b));
let positiveArray = [];

for (let i = 0; i < sortedArray.length; i++) {
if (sortedArray[i] >= 0) {
positiveArray.push(sortedArray[i]);
}
}

let result = positiveArray[0] + positiveArray[1];
console.log(result);
return result;
}
module.exports = sumTwoSmallestNums;
16 changes: 13 additions & 3 deletions algorithms/challenge-5.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
//Implement the function filterList(arr) that takes a list of non-negative integers and strings and returns a new list with the strings filtered out.
function filterList(arr) {

}
let returnValue = [];

module.exports =filterList
for (let i = 0; i < arr.length; i++) {
if (typeof arr[i] == "number") {
returnValue.push(arr[i]);
}
}

console.log(returnValue);
return returnValue;
}

module.exports = filterList;
Binary file added frontend/image/apps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/image/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/image/avatar_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/image/billing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/image/general.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/image/invitation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/image/logout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/image/password.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 112 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Week One OnRamp Assignment</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lato&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>

<body>

<div class="body-box"></div>
<div class="orange-box"></div>
<div class="content-box"></div>

<div class="menu">
<div class="menu-profile-image"><img src="image/avatar.png" alt="profile image thumnail" class="profile-icon-size"></div>
<div class="menu-profile-image-text">
<div><strong>Ikechi Ucheagwu</strong></div>
<div>@iykeafrica</div>
</div>
<br clear="all" />
<div class="menu-space"></div>

<div class="menu-unselected-item"><img src="image/general.png" alt="homepage menu icon" class="icon-size"></div>
<div class="menu-unselected-item-text">General</div>
<br clear="all" />

<div class="menu-unselected-item"><img src="image/password.png" alt="password menu icon" class="icon-size"></div>
<div class="menu-unselected-item-text">Password</div>
<br clear="all" />

<div class="menu-unselected-item"><img src="image/invitation.png" alt="invitation menu icon" class="icon-size"></div>
<div class="menu-unselected-item-text">Invitations</div>
<br clear="all" />

<div class="menu-container-selected-item">
<div class="vertical-bar"></div>
<div class="menu-selected-item"><img src="image/billing.png" alt="billing menu icon" class="icon-size"></div>
<div class="menu-selected-item-text">Billing</div>
</div>
<br clear="all" />

<div class="menu-unselected-item"><img src="image/apps.png" alt="app menu icon" class="icon-size"></div>
<div class="menu-unselected-item-text">Apps</div>
<br clear="all" />

<div class="menu-unselected-item-logout"><img src="image/logout.png" alt="logout menu icon" class="icon-size"></div>
<div class="menu-unselected-item-logout-text">Log out</div>
<br clear="all" />
</div>

<div class="page">

<div class="list">
<p class="page-strong-color" style="font-size: 25px;"><strong>Billing</strong></p>
<p class="page-strong-color" style="font-size: 14px; margin-bottom: 0px;"><strong>Order History</strong></p>
<p class="page-light-color" style="font-size: 12px; margin-top: 4px; margin-bottom: 50px;">Manage billing information and view receipts</p>
<table style="width:94%;">
<tr style="text-align: left;">
<th class="page-light-color" style="font-size: 12px; padding: 10px;">Date</th>
<th class="page-light-color" style="font-size: 12px; padding: 10px;">Type</th>
<th class="page-light-color" style="font-size: 12px; padding: 10px;">Recipts</th>
</tr>
<tr>
<td><strong>Oct 21, 2021</strong></td>
<td><strong>Pro Annual</strong></td>
<td class="download-button"><strong>Download</strong></td>
</tr>

<tr>
<td><strong>Oct 21, 2021</strong></td>
<td><strong>Pro Annual</strong></td>
<td class="download-button"><strong>Download</strong></td>
</tr>

<tr>
<td><strong>Oct 21, 2021</strong></td>
<td><strong>Pro Annual</strong></td>
<td class="download-button"><strong>Download</strong></td>
</tr>

<tr>
<td><strong>Oct 21, 2021</strong></td>
<td><strong>Pro Annual</strong></td>
<td class="download-button"><strong>Download</strong></td>
</tr>

</table>
</div>

<div class="details">
<div class="square-box">
<div class="text-plan">
<p style="font-size: 12px;">Your plan</p>
<p style="font-size: medium; margin-bottom: 0px;"><strong>Pro Annual</strong></p>
<p style="font-size: 12px; margin-top: 4px; margin-bottom: 25px;">Renews on Nov. 2021</p>
<p style="font-size: 12px; margin-right: 25px; background-color: #ea4c3c; border: 1px solid white; text-align: center; padding: 3px; border-radius: 5px;">Cancel subscription</p>
</div>
</div>
</div>
</div>


</body>

</html>
Loading