代做CS 1103 Spring 2025 Introductory Programming for Engineers and Scientists EXAM 2 Practice代写Matlab语

CS 1103 Spring 2025

Introductory Programming for Engineers and Scientists

EXAM 2 Practice

Exam 1 Practice requires you to download the grader program from BrightSpace. It is called e2practice.p and you can find it under "Exam" and then "Exam 2 Practice". Create a new blank folder where you intend to work on this test and copy the p file there. Make sure that it was not renamed in the process to something like e2practice(1).p or similar. When you start MATLAB, set your current folder to this very same folder. Solve each problem in MATLAB. Make sure to name your solutions (that is, your m-files) as instructed below and that they are located in the same folder as the grader. Run the grader in MATLAB by typing the command: e2practice. The program will display a menu where you have the option to test individual problems one by one. To get the score for your test, select to grade "All Problems." The grader will ask for your vunetid. Makes sure you type it in correctly, all lower case and no extra spaces.  The grader will display your score.

Submission: N/A (for the real test you will need to submit all your m files)

Grading:   Number of problems solved: points: 1: 40;  2: 70;  3: 85;  4: 95;  5: 100;

Password: LoopyTest Problems:

1.      Write a function called pe21 that takes two input arguments indicating the current time: hr for hours and min for minutes. The function checks whether the two inputs can in fact represent time according to the international format. That is, it needs to check that they are both positive integer scalars and hr is between 0 and 23 inclusive and min is between 0 and 59 inclusive. The function returns a logical value: true if the input arguments satisfy these rules and false otherwise.

2.      Write a function called pe22 that takes a positive integer scalar input argument called k. Make sure to check that k satisfies these assumptions and if it does not, return -1. The function computes and returns a row vector consisting of the first k elements of the sequence s defined as

s(1) = 1

s(n) = n*s(n-1) - 1        for all n >= 2

Note that this is not MATLAB code: it is the mathematical definition of the sequence where s(n) means the nth element of the sequence.

3.      Write a function called pe23 that takes A, a matrix and returns another matrix with two columns called ind. The rows of the matrix contain the row and column indexes of all the negative elements of A. The row indexes go into the first column, while the column indexes go to the second column. The function provides these indexes according to row major order of A. For example, the call

>> negs = pe23([-1 -2 0; -3 2 2]);

will make negs equal to  [1 1; 1 2; 2 1]. If there are no negative elements in A, the function returns the empty array.

4.    Write a function that is defined like this: function w = pe24 (v,a,b,c). The first input argument v is a vector, while a, b, and c are all scalars. You do not need to check them. The function replaces every element of v that is equal to a with b and c. For example, the command

>> x = pe24 ([1 2 3],2,4,5); makes x equal to  [1 4 5 3].

5.    Write a function called pe25 that takes four scalar positive integer inputs, month1, day1, month2, day2. These represent two days in 2025. It is guaranteed that the first date is no later than the second one. The function returns a positive integer scalar that is equal to the difference between the two dates in days. For example, this call to the function pe25 (1,30,2,1); would return 2. You do NOT have to check that the input values are of the correct types and they represent valid dates. You are not allowed to use the built-in functions datenum or datetime. Here are the number of days in each month from January to December in 2025: 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31.


热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图