Enable contrast version

Tutor profile: Raghav G.

Inactive
Raghav G.
Computer Science student at Georgia Institute of Technology
Tutor Satisfaction Guarantee

Questions

Subject: Python Programming

TutorMe
Question:

Write a python program to extract email list from a locally saved excel file, and automatically email a user defined message to all the contacts in the list.

Inactive
Raghav G.
Answer:

import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.base import MIMEBase from email import encoders import pandas as pd def send(excel_loc, smtp_slst, em_deets, sub, body, fname="", att=""): df = pd.read_excel(excel_loc) data = pd.DataFrame(df, columns= ['Name','Email']) e_lst = data['Email'].tolist() n_lst = data['Name'].tolist() if att!="": filename = fname attachment = open(att, "rb") p = MIMEBase('application', 'octet-stream') p.set_payload((attachment).read()) encoders.encode_base64(p) p.add_header('Content-Disposition', "attachment; filename= %s" % filename) s = smtplib.SMTP(smtp_slst[0], smtp_slst[1]) s.starttls() s.login(em_deets[0], em_deets[1]) for i in range(len(n_lst)): mail = MIMEMultipart() mail["From"] = em_deets[0] mail["To"] = e_lst[i] mail["Subject"] = sub b = "Dear "+ n_lst[i]+"\n"+body mail.attach(MIMEText(b,'plain')) if att!="": mail.attach(p) text = mail.as_string() s.sendmail(em_deets[0], e_lst[i], text) s.quit()

Subject: Java Programming

TutorMe
Question:

Write a Java method that removes and returns the element at the specified index of a doubly linked list. Use the most efficient way possible and the Big O should be O(n).

Inactive
Raghav G.
Answer:

public T removeAtIndex(int index) { T data; //T is generic type if (index < 0 || index >= size) { throw new IndexOutOfBoundsException("Index should be a positive number less than size!"); } else if (index == 0) { data = this.removeFromFront(); } else if (index == size - 1) { data = this.removeFromBack(); } else { DoublyLinkedListNode<T> node = head; for (int i = 0; i < index; i++) { node = node.getNext(); } data = node.getData(); DoublyLinkedListNode<T> next = node.getNext(); //DoublyLinkedListNode is a defined node DoublyLinkedListNode<T> prev = node.getPrevious(); next.setPrevious(prev); prev.setNext(next); size--; } return data; }

Subject: C Programming

TutorMe
Question:

Write a C function that creates a new student struct and adds it to the array of student structs, "class".

Inactive
Raghav G.
Answer:

int addStudent(const char *name, int age, double gpa, const char *id) { int i = 0; while (i<size) { if (my_strncmp (name, class[i].name, my_strlen(name))== 0) { return FAILURE; } i = i+1; } if (my_strlen(id)<MIN_ID_SIZE || size == MAX_CLASS_SIZE) { return FAILURE; } struct student ss; ss.age = age; ss.gpa = gpa; my_strncpy(ss.name, name, MAX_NAME_SIZE); int a = my_strlen(ss.name); ss.name[a] = '\0'; my_strncpy(ss.id, id, MAX_ID_SIZE); int b = my_strlen(id); ss.name[b] = '\0'; class[size] = ss; size++; return SUCCESS; }

Contact tutor

Send a message explaining your
needs and Raghav will reply soon.
Contact Raghav

Request lesson

Ready now? Request a lesson.
Start Lesson

FAQs

What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Lesson" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.
BEST IN CLASS SINCE 2015
TutorMe homepage
Made in California by Zovio
© 2013 - 2021 TutorMe, LLC
High Contrast Mode
On
Off