. Write a script file that will prompt a student to enter his/her class mark of a subject and then examination mark. Calculate the final mark taking 30% and 70% from the class mark and examination marks respectively and display the information to the student as Final mark = …
matlab code:
%%%%%% Q1
cmk=input('enter your class marks: ');
emk=input('enter your e*am marks: ');
fmk=(0.3*cmk)+(0.7*emk);
disp(['Your final marks are: ',num2str(fmk)])
%%%%%% Q2
clear
v=0:100;
c=2;
q=c*v;
plot(v,q)
xlabel('Volatge Volts')
ylabel('Charege Coulumbs')
grid on
%%%%%%%%%%%%%% Q3
john=[10,20,25,20,10,42,55];
james=[25,20,30,35,38,25,35];
days=['Mon','Tue','Wed','Thu','Fri','Sat','Sun']
plot(1:7,john)
hold on
plot(1:7,james)
legend('John','James')
xlabel('Day of week')
ylabel('Distance travelled')
%xticks(days)
%%%%%%%%%%%%%%%%
outputs:
Comments
Leave a comment