国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

EP3BB3編程代寫(xiě)、C++程序設(shè)計(jì)代做
EP3BB3編程代寫(xiě)、C++程序設(shè)計(jì)代做

時(shí)間:2025-01-15  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



EP3BB3 Lab #1-2024/25-V1.3 

Lab 1: Introduction to C Programming 
1 Introduction 
This lab serves as an introduction to C programming language for those who may be new to it, and a 
refresher for those familiar with it. The aim is not an in-depth exploration of C but a review of the basics 
through exercises to ensure your readiness for its applications in the upcoming labs. 
1.1 Software Installation 
In case you haven’t done so already, install Visual Studio Code and C using the instructions provided on 
Avenue to Learn. Please note that this step is time consuming and therefore, you should do this ahead 
of your lab. 
1.2 Hello World! 
To ensure that you have set up Visual Studio Code correctly, open Visual Studio Code and create a New 
File. Name it as you want as file_name.c. Copy the following code: 
#include <stdio.h> 
 
int main(void){ 
 printf("Hello World!"); 
 return 0; 

 
Then use the icon “Debug C/C++ File” from the top right corner of the page (see the image below). You 
should see the phrase “Hello World” in the terminal window. Now that we confirmed everything works, 
let’s get to the lab! 
 
 
  EP3BB3 Lab #1-2024/25-V1.3 
 
 

 
2 Lab 1 – The Real Thing 
In this lab, we will have different exercises with a strong focus and emphasis on binary and bitwise 
operations as these will be an essential concept throughout this semester. 
2.1 Sample Program 
Recommended duration for task completion: 10 minutes 
Recall this program from your lecture notes which reads three integer values from the user and prints the 
average. Let’s quickly review this program: 
#include <stdio.h> 
 
int main(void) 

 int value1, value2, value3; 
 float sum, average; 
 
 printf("What is the first value? "); 
 scanf("%d", &value1); 
 
 printf("What is the second value? "); 
 scanf("%d", &value2); 
 
 printf("What is the third value? "); 
 scanf("%d", &value3); 
 
 sum = value1 + value2 + value3; 
 average = sum / 3; 
 
 printf("The average of %d, %d, and %d is %f\n", value1, value2, value3, 
average); 
 
 return 0; 

 
We will be using this example to introduce debuggers! Debuggers help you inspect different portions of 
the code and understand how different variables change as the program runs. You can add “Breakpoints” 
to force your code to pause when it reaches certain points. To enable breakpoints for different lines, you 
can simply click in the area next to the line number (see below).  EP3BB3 Lab #1-2024/25-V1.3 
 
 

 
 
 
In the example above, we have added two breakpoints in lines 17 and 18. When you run the code by 
pressing Debug C/C++ File, an icon bar appears on the top of screen and when it reaches the breakpoint, 
it will look similar to the image below. Visit this page and review the “Debug actions” table to learn more 
about these icons. 
 
 
 
Now, the values for different variables before calculations of lines 17 and 18 are listed on the left side of 
your screen (see below, picture “a”). When you press “Step Over” from the icon bar above, the values will 
be updated (see below, picture “b”). 
 
 
In addition, after running the debugger, you can right click on any variable in your code and select “Add 
to Watch” to inspect that variable. 
 
Task #2.1: Use the debugger yourself and explain the program above to your TA line by line. 
(a) (b)  EP3BB3 Lab #1-2024/25-V1.3 
 
 

 
2.2 if-else Conditional Statements 
Recommended duration for task completion: 20 minutes 
Task #2.2: Write a program that reads a non-zero number from the user and determines if it is even or 
odd. Explain the program to your TA line by line. 
#include <stdio.h> 
 
int main(void) 

 // Declare an integer. 
 
 printf("Please enter a non-zero number: "); 
 
 // read the number from the user using scanf. 
 
 // In the following if statement, determine if the number is divisible by 2 
using the modulo operator. 
 
 /* 
 if (CONDITION) { 
 // Print the entered number is even/odd. You must show the number entered 
by the user. 
 } 
 
 else { 
 // Print the entered number is odd/even. You must show the number entered 
by the user. 
 } 
 */ 
 
 return 0; 

  EP3BB3 Lab #1-2024/25-V1.3 
 
 

 
2.3 While Loops 
Recommended duration for task completion: 20 minutes 
Task #2.3: Write a program, using while loops, that writes numbers from 1 to 10. Explain the program to 
your TA line by line. 
#include <stdio.h> 
 
int main(void){ 
 
 // Declare an integer here and initialize it with a reasonable value. 
 
 
 // The while loop (below) prints the integer and then increments it, as long 
as it satisfies the CONDITION. 
 
 // while (CONDITION) { 
 
 // Print the integer. 
 
 // Increment the integer. 
 
 } 
 return 0; 
}  EP3BB3 Lab #1-2024/25-V1.3 
 
 

 
2.4 For Loops 
Recommended duration for task completion: 20 minutes 
Task #2.4: Write a program, using for loops, that prints all the even numbers between 1 to 10. Explain the 
program to your TA line by line. 
#include <stdio.h> 
 
int main(void){ 
 
 // Declare an integer. 
 
 //The for loop (below) should go through the numbers from 0 to 10 and check 
if the number is divisible by 2. 
 
 //for (start from 0 and increment until 10){ 
 
 /*if (divisible by 2, for example using the modulo operator){ 
 // Print the value. 
 } 
 else 
 { 
 // Don't do anything. 
 }*/ 
 
 
 } 
 return 0; 

  EP3BB3 Lab #1-2024/25-V1.3 
 
 

 
2.5 User-Defined Functions 
Recommended duration for task completion: 20 minutes 
Task #2.5: Rewrite the sample program of task 2.1. Once the user inputs three integers, pass them to 
another function called averageCalculator, which calculates the average and returns the value to the main 
function. The main function, then, prints the calculated average value. Explain the program to your TA line 
by line. 
#include <stdio.h> 
 
float averageCalculator (int a, int b, int c); 
 
float average; 
 
int main(void) 

 int value1, value2, value3; 
 
 printf("What is the first value? "); 
 scanf("%d", &value1); 
 
 printf("What is the second value? "); 
 scanf("%d", &value2); 
 
 printf("What is the third value? "); 
 scanf("%d", &value3); 
 
 // Call the averageCalculator function and pass the values. 
 
 printf("The average of %d, %d, and %d is %f\n", value1, value2, value3, 
average); 
 
 return 0; 

 
// Define a function name averageCalculator which reads three integers (as 
arguments) and returns the parameter average as a float. 
/* 
return_type averageCalculator(arguments) 

 Do the calculations here and return the average! 

*/ 
  EP3BB3 Lab #1-2024/25-V1.3 
 
 

 
3 Bitwise operations 
Due to the importance of bitwise operations in the future labs, we will now work on some exercises 
related to this topic. 
3.1 Exercise 3.1 
Recommended duration for task completion: 30 minutes 
Task #3.1: Study and complete the following code. In this code, the user enters two decimal numbers. The 
code will calculate different bitwise operations and prints the results represented in decimal. For example, 
take a value of 7 for a (0000 0111 in binary) and a value of 12 for b (0000 1100 in binary). A bitwise AND 
of these values is 4 represented in decimal which is 0000 0100 in binary. Complete the code, use a 
different set of input number, and show that your results from your on-paper calculations and those 
derived from your code match. 
 
#include <stdio.h> 
 
int main(void) 

 int a, b; 
 
 printf("What is the first value (in decimal)? "); 
 scanf("%d", &a); 
 
 printf("What is the second value (in decimal)? "); 
 scanf("%d", &b); 
 
 printf("The bitwise AND of %d, and %d, REPRESENTED IN DECIMAL, is %d\n", a, 
b, a & b); 
 
 // Print the bitwise OR of the two numbers. 
 
 // Print the bitwise XOR of the two numbers. 
 
 // Print the bitwise NOT of one of the numbers. 
 
 // Print the bitwise left shift (shifted by one bit) of one of the numbers. 
 
 // Print the bitwise right shift (shifted by one bit) of one of the numbers. 
 
 return 0; 

  EP3BB3 Lab #1-2024/25-V1.3 
 
 

 
3.2 Exercise 3.2 
Recommended duration for task completion: 30 minutes 
Imagine you are in a room which has 8 LED light switches controlling 8 different LED lights. Of course, at 
any given time, each light can be either on or off. The goal is to independently control these LEDs without 
unintentionally affecting the others. Maybe you want to turn on (or SET) specific LEDs. Maybe you want 
to turn off (or CLEAR) some or all of them. Maybe, and maybe, you want to flip (or TOGGLE) specific ones. 
Or perhaps, you want to play a prank on your roommate by flipping all the switches, turning on what’s off 
and turning off what’s on (INVERT). 
LED 7 LED 6 LED 5 LED 4 LED 3 LED 2 LED 1 LED 0 
OFF OFF ON OFF ON OFF ON ON 
 
Well, as it turns out, this is what your microcontroller looks like. For instance, PORT1 of your 
microcontroller has 8 pins (labeled from 0 to 7). Let’s do ourselves a favor and consider them a binary 
sequence. Each pin can have a value of 0 or 1 (i.e., binary). In these cases, it is important to know the 
current state of the system as well as the change you want to impose on the system. You can then 
calculate the final state of the system using the bitwise assignment operators. These are basically the 
same bitwise operators from Exercise 3.1, however they are now followed by the assignment “=” sign. So, 
what’s the difference? 
The bitwise AND assignment (&=) first calculates the bitwise AND operation between operands and then 
assigns the value to the left operand. It can be used to clear bits. 
The bitwise OR assignment (|=) first calculates the bitwise OR operation between operands and then 
assigns the value to the left operand. It can be used to set bits. 
The bitwise XOR assignment (^=) first calculates the bitwise XOR operation between operands and then 
assigns the value to the left operand. It can be used to toggle bits. 
Lastly, the operation ~ can be used to invert bits: turning all ones to zeros and vice versa. 
Let’s work through an example. Imagine the initial state of the system of LEDs in the table above is 0010 
1011 (equivalent to 43 in decimal), where each bit represents the state of a specific pin, with 0 and 1 
indicating states such as ON/OFF. Now, let’s say you want to turn off all LEDs except the 6th bit (or LED #5) 
i.e., 0010 0000 (or 32 in decimal). You can CLEAR using the bitwise AND assignment operation (&=). Use 
the following code for a practical demonstration. 
Task #3.2: After making this observation, complete the code below to calculate the bitwise OR assignment 
and the bitwise XOR assignments for a different set of input states (initial state and change). Show that 
your results from your on-paper calculations and those derived from your code match. More importantly, 
explain how these different operations can be used to set/clear/toggle/invert bits. 
  EP3BB3 Lab #1-2024/25-V1.3 
 
 
10 
 
#include <stdio.h> 
 
int main(void) 

 
 int initialstate, change, tempstate; 
 
 printf("What is the initial state (in decimal)? "); 
 scanf("%d", &initialstate); 
 tempstate = initialstate; 
 
 printf("What is the change (in decimal)? "); 
 scanf("%d", &change); 
 
 initialstate &= change; 
 printf("The &= of %d, and %d is %d\n", tempstate, change, initialstate); 
 
 return 0; 

 
  EP3BB3 Lab #1-2024/25-V1.3 
 
4 Code Submission 
Codes for all tasks must be submitted before the deadline (Jan 12th, 2025 by 7:30 PM EST) on Avenue to 
Learn. 
  EP3BB3 Lab #1-2024/25-V1.3 
 
5 What’s Next? 
5.1 Assessment and Reflection on the Lab 
Spend a few minutes and reflect on what you learned today. Your TAs will assess your lab based on your 
understanding and explanation of what you have done, observed, and learned during this lab (and the 
pre-lab when applicable). Explain the technical details to your TAs and share your takeaways of the lab. 
Half of your mark for the lab is dedicated to your code and its functionality and the other half to your 
understanding and explanations. 
Even though you are working in groups of 2, you are expected to write your own codes and do each tasks 
individually. However, you are encouraged to discuss your approach with your lab partner. 
 
5.2 Tidying Up 
Firstly, great work finishing your lab! You can leave the lab after cleaning your workstation: 
• Remove the jumper wires from your breadboard and dump them in the wire containers on your 
workstation. 
• Remove the components from your breadboard and place them in the component containers at 
your workstation. Make sure to put the components back in the right drawers. 
• Disconnect the probes from your power supply, function generator, multimeter, and oscilloscope, 
and hang them from the wire rack on the wall. 
• Remove any pieces of paper, garbage, etc., from and clean your workstation before leaving the 
lab. 
Note: You are always expected to clean your workstation before leaving the lab. 
 
5.3 Next Lab’s Preparation 
The lab manual for the next lab on “Introduction to Microcontrollers” is available on Avenue to Learn. 
Please review the lab manual before attending the lab. In particular: 
• Follow the instructions published on Avenue to Learn to purchase the microcontroller and bring 
your microcontroller to the lab. 
• Before coming to the lab, you must review the prelab and follow the instructions to install 
CCSTUDIO — Code Composer Studio™ integrated development environment (IDE). This should be 
done before coming to the lab. 
• After installing the IDE, follow the prelab’s blink test to make sure everything is set properly. 

請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp





 

掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇:優(yōu)易花唄客服電話在線解決客戶強(qiáng)制下款問(wèn)題!
  • 下一篇:防靜電門禁系統(tǒng)-ESD防靜電門禁工程方案-蘇州訊諾
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場(chǎng)仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲勞振動(dòng)
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個(gè)行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開(kāi)團(tuán)助手,多多出評(píng)軟件徽y1698861
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開(kāi)團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服務(wù)平臺(tái)
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 寵物飼養(yǎng) 十大衛(wèi)浴品牌排行 suno 豆包網(wǎng)頁(yè)版入口 wps 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    欧美日韩无遮挡| 国产成人黄色片| 国产aaa一级片| 精品免费国产| 国产精品成人播放| 国产精品久久国产精品99gif | 日韩亚洲精品视频| 国产福利久久| 久久精品国产电影| 国产精品久久久久久久7电影| 日韩专区中文字幕| 久久天天躁狠狠躁夜夜躁 | 久热精品在线视频| 久久99精品视频一区97| 中文字幕在线亚洲精品| 亚洲xxxx视频| 人妻无码久久一区二区三区免费| 欧美亚洲视频一区二区| 国产综合欧美在线看| 国产精品一二区| 2019日韩中文字幕mv| 日韩中文字幕视频| 久久综合88中文色鬼| 欧美激情aaaa| 日韩福利二区| 精品视频一区在线| 久久综合精品一区| 北条麻妃一区二区三区中文字幕 | 久久久久久久久久久久久国产| 久久精品视频一| 在线一区日本视频| 日本久久久网站| 国产日本欧美一区二区三区| 91精品国产亚洲| 国产精品久久久久久久久 | 精品视频高清无人区区二区三区| 国产精品一线二线三线| 久草一区二区| 色综合视频一区中文字幕| 日本女人高潮视频| 国产欧美一区二区三区久久 | 一区二区精品在线| 欧美日韩不卡在线视频| 高清在线观看免费| 精品国产一区二区三区在线观看| 精品国产乱码久久久久久蜜柚| 一区二区国产日产| 青青草视频在线视频| 国产美女被下药99| 日韩视频中文字幕| 亚洲第一页在线视频| 激情网站五月天| 国产成人在线亚洲欧美| 免费av在线一区| 日韩美女中文字幕| 99视频国产精品免费观看| 久久视频在线免费观看| 天天在线免费视频| 国产男女无遮挡| 国产精品网址在线| 欧美专区第一页| 99福利在线观看| 国产精品第12页| 欧美日韩一区二区三| 久久免费视频1| 中文字幕欧美日韩一区二区| 免费精品视频一区| 国产成人午夜视频网址| 日本国产欧美一区二区三区| 91久久久久久久一区二区| 久久国产精品偷| 国产专区一区二区三区| 国产精品视频一区二区三区四| 日本人成精品视频在线| 91高清免费视频| 亚洲第一在线综合在线| 99精品国产高清在线观看| 欧美精品少妇videofree| 免费日韩中文字幕| 久久精品视频亚洲| 激情一区二区三区| 国产精品免费观看高清| 免费黄色福利视频| 国产精品久久久久久久久久久久 | 久操手机在线视频| 日本精品一区二区三区在线播放视频| 99爱精品视频| 亚洲国产欧美日韩| 久久婷婷开心| 日韩视频专区| 久久精品国产亚洲精品| 激情六月天婷婷| 精品伦理一区二区三区| 国产内射老熟女aaaa| 一级一片免费播放| 91精品一区二区三区四区| 亚洲一区二区三区视频| 99在线视频首页| 天天爽天天狠久久久| 国产xxxx振车| 欧美极品一区| 国产精品久久久久久网站 | 欧美亚洲在线视频| 国产精品美女视频网站| 精品少妇人妻av一区二区| 美女视频久久黄| 91久久久久久国产精品| 日本公妇乱淫免费视频一区三区| 国产成人精品一区| 国产日韩精品电影| 亚洲欧美日韩不卡一区二区三区| 国产成人综合av| 国内免费久久久久久久久久久| 欧美日本亚洲视频| 久热免费在线观看| 欧美一级片免费观看| 日韩中文字幕亚洲| 国产欧美日韩视频一区二区三区| 久久久久久com| 久久99九九| 国产区欧美区日韩区| 综合一区中文字幕| 久久96国产精品久久99软件| 国内精品国产三级国产99| 宅男av一区二区三区| 久久久中文字幕| 国模视频一区二区三区| 亚洲视频在线二区| 国产成人免费91av在线| 国产精品专区第二| 视频一区亚洲| 国产精品成人播放| 久久久午夜视频| 韩国一区二区av| 川上优av一区二区线观看| 久久久国产成人精品| av资源一区二区| 国内偷自视频区视频综合| 亚洲第一综合网站| 欧美成aaa人片在线观看蜜臀| 国产精品99久久久久久大便| 免费一区二区三区| 日韩av大片在线| 欧美日韩国产二区| 久久人人爽人人爽爽久久| 国产精品一区二区免费在线观看| 欧美最猛性xxxxx(亚洲精品)| 亚洲一区二区免费| 国产精品精品软件视频| 久久免费视频2| 国产精品自产拍高潮在线观看| 欧美综合激情网| 欧美一区二区视频17c| 九九精品在线视频| 国产精品久久久久久av| 久久久久se| 操人视频欧美| 国产在线一区二区三区欧美| 日韩免费观看av| 日韩中文字幕在线不卡| 久久777国产线看观看精品| 日韩中文字幕国产| 国产a级片免费看| 91精品国产成人| 国产精品亚洲欧美导航| 狠狠色狠狠色综合人人| 青草青草久热精品视频在线观看| 日韩一级特黄毛片| 亚洲一区二区三区视频| 久久久久久国产精品三级玉女聊斋| 国产精品日韩一区| www.久久久久| 久久久久久久久久久久久久国产 | 欧美一区国产一区| 日韩精品久久一区| 日韩中文字幕一区| 午夜精品美女久久久久av福利| 免费99精品国产自在在线| 精品视频9999| 久久97精品久久久久久久不卡 | 日韩精品第一页| 色爱区成人综合网| 色一情一乱一伦一区二区三区| 午夜精品久久久久久久99热| 亚洲一区二区三区久久| 亚洲一区二区三区香蕉 | 精品91免费| 精品视频一区二区在线| 免费国产黄色网址| 国产日韩在线精品av| 国产毛片久久久久久国产毛片| 国产热re99久久6国产精品| 国产女人18毛片| yy111111少妇影院日韩夜片| 国产乱码一区| 99热在线国产| 久久男人资源视频| 久久久久亚洲精品| 国产成人精品一区二区在线| 国产精品免费久久久久影院|