Free udemy course!!! Also is this how they make random things?

closed account (367kGNh0)
Hello,

Firstly I wanted to share this free c++ udemy course coupon worth £9.99. :

https://www.udemy.com/cpp-course/?couponCode=CPP_FREE you should paste it into the URL bar.

Another if you are interested in cocos 2d game development!

https://www.udemy.com/cocos2d-x-v3-cpp/?couponCode=CCDX-FREE again you should paste it into the URL bar.


now to my C++ question, In the world of app development, while experimenting I wondered, is this how they get their app to generate random words(for example the caption during a loading screen):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<iostream>
#include <ctime>
#include <cstdlib>
using namespace std;

int main () {
	
	srand(time(0));
	int Juki = 1+rand()%9;
		
	Juki;
	
	if(Juki == 1)
	{cout<<"We are gonna do Diving";}
	
	else if(Juki == 2)
	{cout<<"We are gonna do Lapping";}
	
	else if(Juki == 3)
	{cout<<"We are gonna do Cannonballing";}

	else if (Juki == 4)
	{cout<<"We are gonna do Butterfly kicking";}
	
	else if (Juki == 5)
	{cout<<"We are gonna do Paddling";}
	
	else if (Juki == 6)
	{cout<<"We are gonna do Swimming";}
	
	else if (Juki == 7)
	{cout<<"We are gonna do sidestroke";}
	
	else if (Juki == 8)
	{cout<<"We are gonna do front crawl";}
	
	else if (Juki == 9)
	{cout<<"We are gonna do breast stroke";}
	
		
	
	return 0;
}

Last edited on
Topic archived. No new replies allowed.