This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Task 1: | |
#Write a program that asks the user for 3 numbers and outputs the average of the numbers. | |
''' | |
sum =0 | |
for i in range(1,4): | |
num = int(input('Enter number {}: '.format(i))) | |
sum += num | |
print('Average is: {}'.format(sum/3)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = 5 | |
y = 10 | |
temp = x | |
x = y | |
y = temp | |
print(x) | |
print(y) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/****************************************************************************** | |
Online C++ Compiler. | |
Code, Compile, Run and Debug C++ program online. | |
Write your code in this editor and press "Run" button to compile and execute it. | |
*******************************************************************************/ | |
#include <iostream> | |
#include <string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class Cat | |
{ | |
string name; | |
string breed; | |
int age; | |
public: | |
void setName(string nameIn); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Goal: practice creating and using classes. | |
**Create a class called Cat. | |
**Create the following members: | |
**private members: name, breed, age | |
**public members: setName, setBreed,setAge | |
**getName, getBreed, getAge, printInfo*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class Dog | |
{ | |
string name; | |
int licenseNumber; | |
public: | |
void setName(string nameIn); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Give this class | |
/*The header file for main.cpp*/ | |
#include<iostream> | |
using namespace std; | |
class Dog | |
{ | |
string name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Goal: Practice using a class*/ | |
#include<iostream> | |
using namespace std; | |
class Student | |
{ | |
string name; | |
int id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.reviapps.traveldistance.business; | |
import android.app.Notification; | |
import android.app.NotificationChannel; | |
import android.app.NotificationManager; | |
import android.app.PendingIntent; | |
import android.app.Service; | |
import android.content.Intent; | |
import android.location.Location; | |
import android.os.Build; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///// variable naming ///// | |
//bad | |
double m1=13; | |
double m2=14; | |
double sum = m1+m2; | |
//kinda better | |
double mark1 =13; | |
double mark2 =14; | |
double sum_marks = mark1+mark2; |