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

Adding in a few more tests #35

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ⬆️ Amazon Web Services Certified (AWS Certified) Solutions Architect Associate (SAA-C03) Practice Tests Exams Questions & Answers
*# ⬆️ Amazon Web Services Certified (AWS Certified) Solutions Architect Associate (SAA-C03) Practice Tests Exams Questions & Answers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need the star here?:)


![Promotional image](images/promotional.png)

Expand Down Expand Up @@ -9122,14 +9122,12 @@ A company is running a multi-tier web application on AWS. The application runs i

**[⬆ Back to Top](#table-of-contents)**

### A web application must persist order data to Amazon S3 to support neat-real time processing. A solutions architect needs create an architecture that is both scalable and fault tolerant.Which solutions meet these requirements? (Choose two.)
- [ ] Write the order event to an Amazon DynamoDB table. Use DynamoDB Streams to trigger an AWS Lambda function that parses the payload and writes the data to Amazon S3.
- [x] Write the order event to an Amazon Simple Queue Service (Amazon SQS) queue. Use the queue to trigger an AWSLambda function that parsers the payload and writes the data to Amazon S3.
- [ ] Write the order event to an Amazon Simple Notification Service (Amazon SNS) topic
- [ ] Use the SNS topic to trigger an AWS Lambda function that parses the payload and writes the data to Amazon S3.
- [x] Write the order event to an Amazon Simple Queue Service (Amazon SQS) queue. Use an Amazon EventBridge (Amazon CloudWatch Events) rule to trigger an AWS Lambda function that parses the payload and writes the data to Amazon S3.
- [ ] Write the order event to an Amazon Simple Notification Service (Amazon SNS) topi
- [ ] Use an Amazon EventBridge (Amazon CloudWatch Events) rule to trigger an AWS Lambda function that parses the payload andwrites the data to Amazon S3.
### A web application must persist order data to Amazon S3 to support near-real time processing. A solutions architect needs to create an architecture that is both scalable and fault tolerant. Which solutions meet these requirements? (Choose two.)
- [ ] Write the order event to an Amazon DynamoDB table. Use DynamoDB Streams to trigger an AWS Lambda function that parses the payload and writes the data to Amazon S3.
- [x] Write the order event to an Amazon Simple Queue Service (Amazon SQS) queue. Use the queue to trigger an AWS Lambda function that parses the payload and writes the data to Amazon S3.
- [ ] Write the order event to an Amazon Simple Notification Service (Amazon SNS) topic. Use the SNS topic to trigger an AWS Lambda function that parses the payload and writes the data to Amazon S3.
- [x] Write the order event to an Amazon Simple Queue Service (Amazon SQS) queue. Use an Amazon EventBridge (Amazon CloudWatch Events) rule to trigger an AWS Lambda function that parses the payload and writes the data to Amazon S3.
- [ ] Write the order event to an Amazon Simple Notification Service (Amazon SNS) topic. Use an Amazon EventBridge (Amazon CloudWatch Events) rule to trigger an AWS Lambda function that parses the payload and writes the data to Amazon S3.

### A company has an application hosted on Amazon EC2 instances in two VPCs across different AWS Regions. To communicate with each other, the instances use the internet for connectivity. The security team wants to ensure that no communication between the instances happens over the internet.What should a solutions architect do to accomplish this?
- [ ] Create a NAT gateway and update the route table of the EC2 instancesג€™ subnet.
Expand Down Expand Up @@ -9183,10 +9181,11 @@ A company is running a multi-tier web application on AWS. The application runs i

### A company hosts an application on AWS. The application gives users the ability to upload photos and store the photos in an Amazon S3 bucket. The company wants to use Amazon CloudFront and a custom domain name to upload the photo files to the S3 bucket in the eu-west-1 Region. Which solution will meet these requirements? (Choose two.)

- [x] Use AWS Certificate Manager (ACM) to create a public certificate in the us-east-1 Region. Use the certificate in CloudFront. Most Voted
- [x] Use AWS Certificate Manager (ACM) to create a public certificate in the us-east-1 Region. Use the certificate in CloudFront.
- [ ] Use AWS Certificate Manager (ACM) to create a public certificate in eu-west-1. Use the certificate in CloudFront.
- [ ] Configure Amazon S3 to allow uploads from CloudFront. Configure S3 Transfer Acceleration.
- [x] Configure Amazon S3 to allow uploads from CloudFront origin access control (OAC). Most Voted
- [x] Configure Amazon S3 to allow uploads from CloudFront origin access control (OAC).
- [ ] Configure Amazon S3 to allow uploads from CloudFront. Configure an Amazon S3 website endpoint.

**[⬆ Back to Top](#table-of-contents)**
*
129 changes: 129 additions & 0 deletions quizapp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
import tkinter as tk
from tkinter import messagebox
import os

# Questions and answers
def load_questions_from_readme():
questions = []
if os.path.exists("README.md"):
with open("README.md", "r") as file:
lines = file.readlines()
question = None
options = []
correct = None
for line in lines:
line = line.strip()
if line.startswith("###"):
if question:
questions.append({"question": question, "options": options, "correct": correct})
question = line[3:].strip()
options = []
correct = None
elif line.startswith("- [ ]"):
options.append(line[5:].strip())
elif line.startswith("- [x]"):
options.append(line[5:].strip())
correct = len(options) - 1
if question:
questions.append({"question": question, "options": options, "correct": correct})
return questions

questions = load_questions_from_readme()

class QuizApp:
def __init__(self, root):
self.root = root
self.root.title("Quiz App")
self.current_question = 0
self.score_correct = 0
self.score_incorrect = 0
self.create_widgets()

def create_widgets(self):
self.question_label = tk.Label(self.root, text=questions[self.current_question]["question"], wraplength=400, font=("Helvetica", 12, "bold"))
self.question_label.grid(row=0, column=0, columnspan=2, pady=20)

self.var = tk.IntVar()
self.var.set(-1)

self.option_buttons = []
for idx, option in enumerate(questions[self.current_question]["options"]):
btn = tk.Radiobutton(self.root, text=option, variable=self.var, value=idx, wraplength=400)
btn.grid(row=1+idx, column=0, columnspan=2, sticky="w", padx=20, pady=5)
self.option_buttons.append(btn)

button_frame = tk.Frame(self.root)
button_frame.grid(row=1+len(questions[self.current_question]["options"]), column=0, columnspan=2, pady=20)

self.submit_button = tk.Button(button_frame, text="Submit", command=self.check_answer)
self.submit_button.grid(row=0, column=0, padx=10, pady=10)

self.reset_button = tk.Button(button_frame, text="Reset", command=self.reset_answer)
self.reset_button.grid(row=0, column=1, padx=10, pady=10)

self.next_button = tk.Button(button_frame, text="Next", command=self.next_question)
self.next_button.grid(row=0, column=2, padx=10, pady=10)

self.back_button = tk.Button(button_frame, text="Back", command=self.previous_question, state="disabled")
self.back_button.grid(row=0, column=3, padx=10, pady=10)

score_frame = tk.Frame(self.root)
score_frame.grid(row=2+len(questions[self.current_question]["options"]), column=0, columnspan=2, pady=20)

self.correct_label = tk.Label(score_frame, text=f"Correct: {self.score_correct}", fg="green")
self.correct_label.grid(row=0, column=0, padx=10)

self.incorrect_label = tk.Label(score_frame, text=f"Incorrect: {self.score_incorrect}", fg="red")
self.incorrect_label.grid(row=0, column=1, padx=10)

def next_question(self):
self.current_question += 1
if self.current_question >= len(questions):
messagebox.showinfo("Quiz Completed", f"Your score is {self.score_correct}/{len(questions)}")
self.root.quit()
else:
self.question_label.config(text=questions[self.current_question]["question"])
self.var.set(-1)
for idx, option in enumerate(questions[self.current_question]["options"]):
self.option_buttons[idx-1].config(text=option, fg="black")
self.submit_button.config(state="normal")
self.back_button.config(state="normal" if self.current_question > 0 else "disabled")

def previous_question(self):
self.current_question -= 1
self.question_label.config(text=questions[self.current_question]["question"])
self.var.set(-1)
for idx, option in enumerate(questions[self.current_question]["options"]):
self.option_buttons[idx].config(text=option, fg="black")
self.submit_button.config(state="normal")
self.back_button.config(state="normal" if self.current_question > 0 else "disabled")

def reset_answer(self):
self.var.set(-1)
for btn in self.option_buttons:
btn.config(fg="black")
self.submit_button.config(state="normal")
self.next_button.config(state="disabled")

def check_answer(self):
selected = self.var.get()
if selected == -1:
messagebox.showwarning("Warning", "Please select an answer.")
return

if selected == questions[self.current_question]["correct"]:
self.option_buttons[selected].config(fg="green")
self.score_correct += 1
else:
self.option_buttons[selected].config(fg="red")
self.score_incorrect += 1

self.correct_label.config(text=f"Correct: {self.score_correct}")
self.incorrect_label.config(text=f"Incorrect: {self.score_incorrect}")

self.next_button.config(state="normal")

if __name__ == "__main__":
root = tk.Tk()
app = QuizApp(root)
root.mainloop()