Programming / Re: Help Me With This Javascript Problem by africanman85: 8:50am On Aug 18, 2021 |
Sapeleboy911: function calcAverage(value1, value2, value3){ return (value1 + value2 + value3) / 3; };
// The code above calculates the average of any 3 given numbers.
let avgDolphins = calcAverage(10, 15, 20);
let avgKoalas = calcAverage(30, 40, 20);
//The code above is calling the calcAverage function and assigning it to variables.
function checksWinner(avgDolphins, avgKoalas){ if(avgDolphins >= 2 * avgKoalas){ return `Dolphins wins (${avgDolphins} VS ${avgKoalas}) `; }else if(avgKoalas >= 2 * avgDolphins){ return (`Koalas Wins (${avgKoalas} VS ${avgDolphins})`); }else{ return "No winner"; } }
You can use console.log instead of using different return statements in one function. It's just a bad habit of mine. This must be Jonas Schmedtmann's course on udemy, I'm a student of the course too. Just rounded up the loop section. Your code is returning nothing in the console. Re-check your code. Your last calibrace, i dont know the function is holding.
|
Programming / Re: Help Me With This Javascript Problem by africanman85: 8:36am On Aug 18, 2021 |
|
Programming / Re: Help Me With This Javascript Problem by africanman85: 1:17am On Aug 18, 2021 |
Capslock01: const calcAverage1 = function (dolphins1, dolphins2, dolphins3) { const avgDolphins = (dolphins1 + dolphins2 + dolphins3)/3; console.log('Dolphins Average is ---> ' + avgDolphins) } avgDolphins = calcAverage1 (44, 23, 71); //Test for Data 1 --- "Value is 46"
const calcAverage2 = function (Koalas1, Koalas2, Koalas3) { const avgKoalas = (Koalas1 + Koalas2 + Koalas3)/3; console.log('Koalas Average is ---> '+ avgKoalas) } avgKoalas = calcAverage2 (65, 54, 49); //Test for Data 2 --- "Value is 56"
//This code takes Average as parameters function checkWinner (avgDolphins, avgKoalas) { if (avgDolphins >= 2*avgKoalas) { console.log (`Delphins win (${avgDolphins} vs ${avgKoalas})`); } else if (avgKoalas >= 2*avgDolphins) { console.log (`Koalas win (${avgDolphins} vs ${avgKoalas})`); } else { console.log('No team win') } }
checkWinner(46, 56) //Test for Data 1 Average
I hope this help. I will try to help you to refine the code tomorrow. Ok sir |
Programming / Re: Help Me With This Javascript Problem by africanman85: 10:59pm On Aug 17, 2021 |
etoluw: let CalcAverage = (a,b,c) => (a+b+c)/3;
checkWinner = (a,b) => a > 2 * b; U used arrow function. I need it to be in function expression. Something like this format: const CalcAverage = function (a, b, c) |
Programming / Help Me With This Javascript Problem by africanman85: 9:17pm On Aug 17, 2021 |
I am new to javascript and finding it difficult to solve this problem with 'javascript function expression'. I can use arrow function. The problem is as bellow: Back to the two gymnastics teams, the Dolphins and the Koalas! There is a new gymnastics discipline, which works differently. Each team competes 3 times, and then the average of the 3 scores is calculated (so one average score per team). A team only wins if it has at least double the average score of the other team. Otherwise, no team wins! Your tasks: 1. Create an arrow function 'calcAverage' to calculate the average of 3 scores 2. Use the function to calculate the average for both teams 3. Create a function 'checkWinner' that takes the average score of each team as parameters ('avgDolhins' and 'avgKoalas'), and then logs the winner to the console, together with the victory points, according to the rule above. Example: "Koalas win (30 vs. 13)" 4. Use the 'checkWinner' function to determine the winner for both Data 1 and Data 2 5. Ignore draws this time Test data: § Data 1: Dolphins score 44, 23 and 71. Koalas score 65, 54 and 49 § Data 2: Dolphins score 85, 54 and 41. Koalas score 23, 34 and 27 1 Like |
Business / Re: This Business Will Take Good Care Of You by africanman85: 3:31pm On Aug 11, 2021 |
O |
|
|
|
Business / Re: My Solar Set Up Journey After A Year. Very Cool by africanman85: 10:15am On Aug 03, 2021 |
eliok: after getting the batteries.
Give electrician to solder it for you.
40 pieces per pack. As shown below. The picture is just an example. Ok, were do u buy the batteries from? |
Business / Re: My Solar Set Up Journey After A Year. Very Cool by africanman85: 8:40am On Aug 01, 2021 |
eliok: let's do the maths , I'm coming Yet to hear from u bro |
Business / Re: My Solar Set Up Journey After A Year. Very Cool by africanman85: 12:26pm On Jul 31, 2021 |
eliok: let's do the maths , I'm coming Ok |
Business / Re: My Solar Set Up Journey After A Year. Very Cool by africanman85: 11:20am On Jul 31, 2021 |
eliok: if you are talking about the laptop battery, i buy them in pieces. #200 naira per piece like how many pieces is enough to power laptop and phone for 15 hours? |
Business / Re: My Solar Set Up Journey After A Year. Very Cool by africanman85: 7:33am On Jul 31, 2021 |
eliok: But here, I will do the laptop battery bank so that you will see.
Step by step.
Pls how much do u get d battery pack? I have a blue Inec Powerbank connected to ups and it trips off when I connect my laptop to the ups. |
Politics / Re: Nepa:you Dey Suffer Yourself If You Get UPS And You No Connect Am To Big Battery by africanman85: 12:00pm On Jul 30, 2021 |
boyjo:
Ah! Solar charge controller is a must o. After the solar panels, na the only thing wey I buy join am. The installation is so so easy.
My broda, as at that time when I wan buy the panel, na the 335W Suntech solar panel just dey my mind. It was N80k! And you know say na around that time I wan buy battery too.
6 units of 50Watts panel, was giving me N90k. So I just reason say instead of make I strain myself remove 80k once, make I dey buy am small small, after all, the over price no too different.
But I also realised that I would be using up more space and cable. I guess it was the price to pay.
Lol, so Jumia do you that January thing ehn?
Can I use a car battery for this setup? Won't it explode ? How long will it last with laptop and how can I charge it with solar ? I have solar panel. |
Business / Re: Inverter And Battery Enquiry by africanman85: 8:59pm On Jul 29, 2021 |
jamesid29:
Without knowing the actual type and rating of the appliances you listed up there, it would be hard for anyone to give you an accurate figure, but I'll try and give you an idea of what you need.
Laptop: Laptops like dell are rated around 65w
Fan: If your fan is the regular type that has its control(where you change the speed) on the body, those are usually rated between 50w- 60w... The ones with their speed control on the head are usually around 130w-150w.... If it's the regular ceiling fan, then it's around 85w.
Bulb: The regular full spiral energy saving bulb (like Akt) is around 40w and the small one is around 18w.
Fridge: Let's put your fridge around 350w. I believe yours should be less than that because most new fridges are energy efficient.
So with this info: Let's say 1laptop, 2 regular energy saving bulbs on per time,1 regular standing fan(control on the body) and 1 fridge.... Your total load per time is around 555w.
A 1.5kva inverter would be ideal for your system(a 1kva can work but it's better to go for a 1.5).
As for batteries: 4 (200ah) would give you roughly 10hours(that's if I want ur batteries to last for 2-3 yrs if not more without issues). Around 14hrs if you want to kill ur batteries in a yr plus.... Pls go for good affordable batteries and not those cheap Alaba ones, if not na every 6months u go dey change batteries.
If you go for[b] 2 (200ah)[/b] batteries, just divide the backup time by half.... (But with good energy efficiency, u can increase the hours).
Hope that helps. It would be great if you can snap the back where the model and other info are written.
Which setup can work for only dell laptop, fan of 18w and phone? |
Programming / Re: One JavaScript Study Partner Needed (online or IB) by africanman85: 3:02pm On Jul 28, 2021 |
roland2rule:
Nice... Can you drop your digit so that we can talk on phone? Thanks I started javascript a week ago |
Adverts / Re: Create A FULL Website With ARTICLES In 2 Minutes Using This FREE Software by africanman85: 8:23pm On Jul 25, 2021 |
Abkolad: Copywriting Automator, I'll also give you sales letter generator and sales copy generator as bonuses Ok, let's exchange. Add me on Wha |
Adverts / Re: Create A FULL Website With ARTICLES In 2 Minutes Using This FREE Software by africanman85: 6:46pm On Jul 25, 2021 |
Abkolad: Articles are unique, and the software can generate a different site from what another person has generated I told u that I will exchange Udemy affiliate marketing tutorial I bought in exchange for your copywriting software. What is d name of the copy writing software u talked about in ur other thread? |
Business / Re: Affiliate Marketing MASTERCLASS For FREE by africanman85: 9:53pm On Jul 21, 2021 |
08032655418 add |
Jobs/Vacancies / Re: Monthly Net Salary Of Federal Government Ministries,departaments, Agencies And P by africanman85: 5:52pm On Jul 14, 2021 |
Nawa, how can I get this connect sef ? |
Programming / Re: Job Prospects For A Junior Developer In Nigeria by africanman85: 10:37am On Jul 14, 2021 |
tensazangetsu20:
At all first remote job was given to me when I posted my project on Reddit. But I have gotten interviews and job offers by applying. It's just that the pay is lower than what I earn so I didn't take it. I want to use Udemy to learn but d file size is huge, like 33gb. I don't know how I can download such huge file now. |
Programming / Re: Am Too Old To Learn Programming ! by africanman85: 5:41pm On Jul 09, 2021 |
tensazangetsu20: You aren't old but please don't learn python Django you will regret it big time O. Learn JavaScript, learn PHP and learn a platform and you will be smiling in eight months time. Why do u say this? |
Business / Re: Container Load Of Household Goods From UK by africanman85: 4:21pm On Jul 09, 2021 |
drlateef: Hello all,
I have container load of household goods from U.K. I can help you ship and clear but you must have at least 10 million naira for the whole package. You can sell items at Alaba etc for over 20 million within a month. They are all items from Amazon. Serious buyers should contact me. If interested send message to me at drlateef@yahoo.com. I am a registered medical doctor so you are only going to get everything legit from me. Wat and Wat is the container? Msg me on africanman85op@gmail.com as am interested |
Business / Re: Pro's Copywriting Automator Software For Giveaway! by africanman85: 6:19pm On Jul 08, 2021 |
Abkolad: Hey guys, I'll like to give away a copywriting automator software that generates converting write-ups for copywriters by just filling in the blanks. Real copy writers would know how much this should worth and could generate for them, so no need for big figures.
BUT, if you're interested, I'd like you to also offer something valuable to me e.g another valuable software in exchange for it.
Thanks I will give direct download for my udemy Complete Shopify Amazon Affiliate course. This course has made me close to $5k if u know what u are doing. |
Business / Re: Urgent Business Needs And Deals: 200 Units Of 25 Litres Of Palm Oil Needed. by africanman85: 10:55am On Jul 08, 2021 |
MessiahMARLIANS: I'm currently in need of 200 Units of 25 litres keg of Unadulterated Palm Oil to be Urgently Supplied to Abuja in the North.
Vehicle for Supply will be made available for transaction to be smoothly processed.
Price offer for each 25 litres Keg of Palm Oil is 23,000 Naira.
The current Price of Palm Oil in the Rural Farmgates in SouthWest and SouthEast ranges between 16,000 - 18,000 naira providing Substantial Profits.
We have got 600 kegs available already and would be needing more for coalition.
Note: The Content of Your Palm Oil should be 100% Pure and Not Adulterated.
Let's Bag The Millions Together. �� 08032655418 |
Business / Re: FREELANCERS: Here's A Working Strategy For Snagging Quality Clients On LINKEDIN by africanman85: 7:35pm On Jun 30, 2021 |
Nice |
Programming / Re: Python Vs Javascript by africanman85: 8:18am On Jun 29, 2021 |
ClixMaster: Lol! Age is not on your side? Where is the age going? Please, learn JavaScript, then progress to react , php, laravel, and finally bury yourself in WordPress . That is the wing I am playing now. Thank u |
Programming / Python Vs Javascript by africanman85: 7:53am On Jun 29, 2021 |
I don't have computer science background but I want to switch to programming. Which between Python and Javascript can bring most work, pay, easy to understand in the freelancing space and career development. Age is not on my side. |
Jobs/Vacancies / Re: Monthly Net Salary Of Federal Government Ministries,departaments, Agencies And P by africanman85: 11:59am On Jun 26, 2021 |
Nigaraw: nah 5m is too much for cbn he can get good paying parastatals like FIRS, NIMASA, NCDMB for lesser amount sef. Don't be deceived by the name CBN doesn't pay up to most parastatals. If you have other options its better to weigh your options Bro, if u have genuine connect, link me pls |
Programming / Re: I Want To Learn Programming. Which Language Should I Start With? by africanman85: 6:57pm On Jun 25, 2021 |
Steveskok: Hi there!
There are a number of programming languages available in the market.
JavaScript. Python Java. C++ GoLang. C# SQL. Dart.
I would suggest you JavaScript and Python
Let me give you a synopsis of JavaScript it is a scripting or programming language that allows you to implement complex features on web pages — every time a web page does more than just sit there and display static information for you to look at — displaying timely content updates, interactive maps, animated 2D/3D graphics, scrolling video jukeboxes, etc. — you can bet that JavaScript is probably involved. It is the third layer of the layer cake of standard web technologies, two of which (HTML and CSS).
Python is an interpreted high-level general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant indentation. Its language constructs, as well as its object-oriented approach, aim to help programmers write clear, logical code for small and large-scale projects
Thanks,
How do u remember code lines. Anytime I close my javascript video tutorial, I became empty and had to go back again. |
Programming / Re: I Want To Learn Programming. Which Language Should I Start With? by africanman85: 6:55pm On Jun 25, 2021 |
Amazingamb:
Don't deject, to know codes takes practice. You just have to keep on practicing. The right step in the direction is knowing what you need. I'm sure you would have heard that even senior Developers still search to get basic things done.. you are in the right direction Am having this problem too. On how to remember codes in javascript |