JavaScript Exercise 10 - Business Name Generator | Sigma Web Development Course - Tutorial #62

preview_player
Показать описание
➡️ English Subtitles are now up for all the videos!

python, C, C++, Java, JavaScript and Other Cheatsheets [++]:

►Learn in One Video[++]:

►Complete course [playlist]:

Follow Me On Social Media
Comment "#HarryBhai" if you read this 😉😉
Рекомендации по теме
Комментарии
Автор

Harry bhai this course is absolutely gem. Though views are not up to the mark til now, but believe me you will see unpredictable love and feedback in near future. I think people who already have little knowledge about web, the are skiping initial videos (which should be not) but keep it up. Love you ❤❤❤❤

usmanmustafa
Автор

hlo harry bhai i am dhruv and i am 19 and a ca (chartered accountant) aspirant but i love coding and enjoying your course and i also watched your previous web develpoment course but that was aoutdated loving this new course

Dhruv_Gupta_
Автор

//Javascript challenge 2
/*Math.random will generate the random no that is equal to 0
or greater than 0 but less than 1 (Inclusive(0) and exclusive(1))
Math.floor()->This function rounds down a number to the nearest integer.
->Math.floor(Math.random() *3) will generate the value that is between
[0, 1, 2] (inclusive (0) and exclusive(3))
*/

//Function 1:Adjective()
function Adjective()
{
let a="Crazy";
let b="Amazing";
let c="Fire";
let ran = Math.floor(Math.random()* 3);
{
switch(ran)
{
case 0:
return a;
break;
case 1:
return b;
break;
case 2:
return c;
break;
defualt:
console.log('Sorry, No more value exists');
}
}
}

//function 2->ShopName()
function ShopNames()
{
let a="Engine";
let b="Foods";
let c="Garments";
let ran
{
switch(ran)
{
case 0:
return a;
break;
case 1:
return b;
break;
case 2:
return c;
break;
defualt:
console.log('Sorry, No more value exists');
}
}
}

//function 3->AnotherWords()
function AnotherWord()
{
let a="Bros";
let b="Limited";
let c="hub";
let ran = Math.floor(Math.random()*3);
{
switch(ran)
{
case 0:
return a;
break;
case 1:
return b;
break;
case 2:
return c;
break;
defualt:
console.log('Sorry, No more value exists');
}
}
}

//Combine all the functions togethers
console.log("The new business name is :" + Adjective()+ " "+
ShopNames()+ " " +AnotherWord() );

fizafashion
Автор

By the simplest from overall programs

function Generator(x, y, z){
let num = Math.floor(Math.random()*3)
if(num == 0)
return x
else if(num == 1)
return y
else
return z
}

console.log("Generated Name is "+Generator("Crazy", "Amazing", "Fire")+" "+Generator("Engine", "Food", "Garment")+" "+Generator("Bros", "Limited", "Hub"))

syedabdulwasay
Автор

Javascript Op
#Solution

let obj1 = {
1:"Crazy",
2 : "Amazing",
3 : "Fire"
}
let obj2 = {
1: "Engine",
2: "Foods",
3: "Garments"
};
let obj3 = {
1: "Bros",
2: "Limited",
3: "Hub"
};



var ran1 = Math.floor(Math.random() * 3) + 1;
var ran2 = Math.floor(Math.random() * 3) + 1;
var ran3 = Math.floor(Math.random() * 3) + 1;




console.log(obj1[ran1] + " " + obj2[ran2] + " " + obj3[ran3]);

Its__AnkitSahu
Автор

Code is:
function adjective(){
let a="Creazy"
let b= "Amazing"
let c= "Fire"
let
if(d==0){return a}
else if(d==1){return b}
else if(d==2){return c}
}
function shopName(){
let a="Engine"
let b= "Foods"
let c= "Garments"
let
if(d==0){return a}
else if(d==1){return b}
else if(d==2){return c}
}
function anotherWord(){
let a="Bros"
let b= "Limited"
let c= "Hub"
let
if(d==0){return a}
else if(d==1){return b}
else if(d==2){return c}
}

console.log("Business Name\n", adjective(), shopName(), anotherWord() )

Venom-Gaming-RJ
Автор

Bro through your videos ppl are really making money like me I made like 10, 000 or more love u and ur vids 💖

Vanshop
Автор

Yaar ye to bht mushkil hai hum jese noob kese leke chalen javascript ko abhi tak to apke sath roz class le rhe the lekin ye exercise nhi smjh arahi

ZubairKhan-zmnw
Автор

#challengeAccepted
const adjectives={
1:"Crazy",
2:"Amazing",
3:"Fire"
}
const shopName={
4:"Engines",
5:"Foods",
6:"Garments"
}
const anotherWord={
7:"Bros",
8:"Limited",
9:"Hub"
}

//this function generates random number from min to max-1
function randNumGenerator(min, max){
return
}

let rand1=randNumGenerator(1, 4);
let rand2=randNumGenerator(4, 7);
let rand3=randNumGenerator(7, 10);

let "+shopName[rand2]+" "+anotherWord[rand3];

console.log(businessName);

BEASTPLAYSYT
Автор

Harry bhaiyya❤#stay_healthy_😊
Love from Nepal

prakashsubedi
Автор

challenge accepted and vid_62 completed!

KartikMittal-jbek
Автор

💣 Blasted my Computer in Javasrcript Introduction

ibrahimmaths
Автор

Challenge Accepted 👍

Here are my efforts: #solution

let title = {
1 : "Crazy",
2 : "Amazing",
3 : "Fire",
}

let shopNames = {
1 : "Engine",
2 : "Foods",
3 : "Garments",
}

let endTitle = {
1 : "Bros",
2 : "Limited",
3 : "Hub",
}

function nameGenerator() {
let random = Math.floor(Math.random() * 3) + 1;
console.log(random);
console.log(`${title[random]} ${shopNames[random]} ${endTitle[random]}`);

}
nameGenerator();

chandanbisht
Автор

#ChallengeAccepted #solution #JavaScriptOP #SigmaBatchOP #html
Solution:
let r1 = Math.floor(Math.random() * 20) % 3;
let r2 = Math.floor(Math.random() * 20) % 3;
let r3 = Math.floor(Math.random() * 20) % 3;

let adjective = {
0: "Crazy",
1: "Amazing",
2: "Fire"
};
let ShopName = {
0: "Engine",
1: "Foods",
2: "Garments"
};
let AnotherWord = {
0: "Bros",
1: "Limited",
2: "Hub"
};

console.log(`${adjective[r1]} ${ShopName[r2]} ${AnotherWord[r3]}`);

navneetgupta
Автор

#Solution

let obj1 = {
1:"Crazy",
2 : "Amazing",
3 : "Fire"
}
let obj2 = {
1: "Engine",
2: "Foods",
3: "Garments"
};
let obj3 = {
1: "Bros",
2: "Limited",
3: "Hub"
};



var ran1 = Math.floor(Math.random() * 3) + 1;
var ran2 = Math.floor(Math.random() * 3) + 1;
var ran3 = Math.floor(Math.random() * 3) + 1;




console.log(obj1[ran1] + " " + obj2[ran2] + " " + obj3[ran3]);

Its__AnkitSahu
Автор

Challenge Accepted
// Create a business name genrator
// Adjective : Crazy, Amazing, Fire
// Name : Engine, Food, Garment
// Another Word : Bros, Limited, Hub

function randomNum (){
let num = Math.random()
if (num<=0.33)
return 1;
else if (num<=0.66) {
return 2;
} else {
return 3;
}
}

function ChooseName(a, b, c){
switch (randomNum()) {
case 1:
return a;
case 2:
return b;
case 3:
return c;
default:
break;
}
}

var name = ChooseName("Crazy ", "Amazing ", "Fire ") + (ChooseName("Engine ", "Food ", "Garment ")) + ChooseName("Bros", "Limited", "Hub")
console.log(name)

truefalse
Автор

console.log("hello world");
function gnrt(maxs, mins){
return Math.floor(Math.random() * (maxs-mins + 1)) + mins;
}
const chk = {
1 : "Crazy ",
2: "Amazing ",
3: "Fire ",
4: "Engine ",
5: "Food ",
6: "Garments ",
7: "Bros",
8: "Limited",
9:"Hub"
}

console.log(chk[gnrt(1, 3)] + chk[gnrt(4, 6)] + chk[gnrt(7, 9)]);

DeepakKumar-ltjn
Автор

let a = Math.floor(Math.random() * 3);
let adj = {
1: "Crazy",
2: "Amazing",
3: "Fire",
};

let b = Math.floor(Math.random() * 3);
let Sname = {
1: "Engine",
2: "Foods",
3: "Garments",
};

let c = Math.floor(Math.random() * 3);
let anotherW = {
1: "Bros",
2: "Limited",
3: "Hub",
};

console.log(`${adj[a]} ${Sname[b]} ${anotherW[c]}`);

SigmaCoder
Автор

i do not use array but i use objects 😁

let btn =

let adjectives = {
1: "Crazy ",
2: "Amazing ",
3: "Fire ",
};
let shop = {
1: "engine ",
2: "foods ",
3: "Garments ",
};
let word = {
1: "Bros",
2: "Limited",
3: "Hub",
};

btn.addEventListener("click", () => {
let name = adjectives[random()] + shop[random()] + word[random()];

= name;
});

function random() {
return Math.floor(Math.random() * 3) + 1;
}

SubhankarRajbanshi-lfhp
Автор

My approach
let r1 = Math.floor(Math.random() * 3);
let r2 = Math.floor(Math.random() * 3);
let r3 = Math.floor(Math.random() * 3);
let adjective = {
0: "Crazy",
1: "Amazing",
2: "Fire",
};
let shopname = {
0: "Engine",
1: "Foods",
2: "Garments",
};
let anotherword = {
0: "Bros",
1: "Limited",
2: "Hub",
};
alert(`Generated Name is ${adjective[r1]} ${shopname[r2]} ${anotherword[r3]}`);

mdalamrahman