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

ZaldarriagaAct1 #6

Open
wants to merge 4 commits into
base: master
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
47 changes: 47 additions & 0 deletions ZaldarriagaMaps.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import 'dart:io';

void main() {
const pizzaPrices =
{
'margherita': 5.5,
'pepperoni': 7.5,
'vegetarian': 6.5,
};
List order = new List();
double totalprice =0;

print('Welcome to Jez Pizza');
print(pizzaPrices);
/*print('What is your order?');
String x = stdin.readLineSync();
x.toLowerCase();

order.add(x);
totalprice = totalprice + pizzaPrices[x];

print('Do you want to add? Y/N');
String response = stdin.readLineSync();
response.toLowerCase();
*/
String response = 'y';
while (response=='y'){
print('What is your order?');
String x = stdin.readLineSync();
x.toLowerCase();
if (pizzaPrices.containsKey(x))
{
totalprice = totalprice + pizzaPrices[x];
order.add(x);
}
else
{
print(x + "pizza is not on the menu");
}
print('Do you want to add? Y/N');
response = stdin.readLineSync();
response.toLowerCase();
}
print("You ordered: $order");
print("Total: $totalprice");

}
26 changes: 26 additions & 0 deletions ZaldarriagaSets.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
void main(){
const a = { 1, 3, 7, 10, 9 };
const b = { 3, 5, 6, 10, 8 };

List arrJez = new List();
int sum = 0;


a.forEach((element) {
if (!b.contains(element)){
arrJez.add(element);
sum = sum + element;
}

});
b.forEach((element) {
if (!a.contains(element)){
arrJez.add(element);
sum = sum + element;
}

});

print(arrJez);
print("Sum: $sum");
}
33 changes: 33 additions & 0 deletions activities/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

import 'dart:io';

void main() {
String fn, mn, ln;
int age;

print('Enter First Name: ');
fn = stdin.readLineSync();
print('Enter Middle Name: ');
mn = stdin.readLineSync();
print('Enter Last Name: ');
ln = stdin.readLineSync();
print('Enter Age: ');
age = int.parse(stdin.readLineSync());
Student s1 = Student(fn, mn, ln, age);
print(s1.getFullName());
}

class Student {
static final String department = 'Computer Science';
String firstName, middleName, lastName;
int age = 18;

Student(this.firstName, this.middleName, this.lastName, this.age);

// Student.withFullName(this.firstName, this.middleName, this.lastName, this.age);


String getFullName(){
return('Hello $firstName $middleName $lastName , $age, from $department department' );
}
}
59 changes: 59 additions & 0 deletions maps and sets - Zaldarriaga/ZaldarriagaMaps.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import 'dart:io';

void main() {
const pizzaPrices =
{
'margherita': 5.5,
'pepperoni': 7.5,
'vegetarian': 6.5,
};
List order = new List();
double totalprice =0;

print('Welcome to Jez Pizza');
print(pizzaPrices);

/* const ordar={'margherita', 'pineapple'};
double tots =0;
ordar.forEach((element) {
if (pizzaPrices.containsKey(element)){
tots = tots + pizzaPrices[element];
}
else{
print("pizza Doesn't exist");
}
});
*/
/*print('What is your order?');
String x = stdin.readLineSync();
x.toLowerCase();

order.add(x);
totalprice = totalprice + pizzaPrices[x];

print('Do you want to add? Y/N');
String response = stdin.readLineSync();
response.toLowerCase();
*/
String response = 'y';
while (response=='y'){
print('What is your order?');
String x = stdin.readLineSync();
x.toLowerCase();
if (pizzaPrices.containsKey(x))
{
totalprice = totalprice + pizzaPrices[x];
order.add(x);
}
else
{
print(x + "pizza is not on the menu");
}
print('Do you want to add? Y/N');
response = stdin.readLineSync();
response.toLowerCase();
}
print("You ordered: $order");
print("Total: $totalprice");

}
26 changes: 26 additions & 0 deletions maps and sets - Zaldarriaga/ZaldarriagaSets.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
void main(){
const a = { 1, 3, 7, 10, 9 };
const b = { 3, 5, 6, 10, 8 };

List arrJez = new List();
int sum = 0;


a.forEach((element) {
if (!b.contains(element)){
arrJez.add(element);
sum = sum + element;
}

});
b.forEach((element) {
if (!a.contains(element)){
arrJez.add(element);
sum = sum + element;
}

});

print(arrJez);
print("Sum: $sum");
}
1 change: 1 addition & 0 deletions zaldarriaga
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello