قديم منذ /03-10-2020, 11:37 PM   #1

طالب جديد

MustafaMeel غير متواجد حالياً

 

مواضيعي | ردودي

 رقم العضوية : 43321
 تاريخ الإنتساب : Oct 2020
 المشاركات : 1
 الجنس : ذكر
 مستوى التقييم : MustafaMeel is on a distinguished road
النقاط : 0

شكراً: 0
تم شكره 0 مرة في 0 مشاركة
افتراضي assignment 1 اللي يقدر يعلمنا طريقة الحل


السلام عليكم اللي يقدر يساعدنا في حل الاسايمنت لا يبخل
شكرا لكم

Q1-Your team was asked to program a self-driving car that reaches its destination with minimum travel time.
Write an algorithm for this car to choose from two possible road trips. You will calculate the travel time of each trip based on the car current speed and the distance to the target destination. Assume that both distances and car speed are given.


Q2-
Write a complete Java program that do the following:
1. Declare String object and a variable to store your name and ID.
2. DisplayYour Name and Student ID.
3. Display Course Name, Code and CRN
4. Replace your first name with your mother/father name.
5. Display it in an uppercase letter.
Note:Your program output should look as shown below.
My Name: Ameera Asiri
My student ID: 123456789
My Course Name: Computer Programming
My Course Code: CS140
My Course CRN: 12345
AIYSHA ASIRI




Q3-Write a tester program to test the mobile class defined below.
Create the class named with your id (for example: Id12345678) with the main method.
a) Create two mobiles M1 and M2 using the first constructor.
b) Print the characteristics of M1 and M2.
c) Create one mobile M3 using the second constructor.
d) Change the id and brand of the mobile M3. Print the id of M3.
Your answer should include a screenshot of the output. Otherwise, you will be marked zero for this question.
public class Mobile **
private int id;
private String brand;

public Mobile() **
id = 0;
brand = "";
**

public Mobile(int n, String name) **
id = n;
brand = name;
**

public void setBrand(String w) **
brand = w;
**

public void setId(int w) **
id = w;
**

Public int getId() **
return id;
**

public String getBrand() **
return brand;
**

**


Answer:




Q4-
Write a method named raiseSalary that accepts two integers as an argument and return its sum multiplied by 15%. Write a tester program to test the method. The class name should be your ID (for example: Id12345678).
Your answer should include a screenshot of the output. Otherwise, you will be marked zero for this question.







الملفات المرفقة
نوع الملف: pdf CS140Assignment 1-Questions-V3 (1).pdf‏ (265.8 كيلوبايت, المشاهدات 12)
  رد مع اقتباس

إضافة رد

مواقع النشر (المفضلة)

الكلمات الدلالية (Tags)
2020 اسسايمنت 140 cs

أدوات الموضوع
انواع عرض الموضوع

تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة
Trackbacks are متاحة
Pingbacks are متاحة
Refbacks are متاحة