加勒比久久综合,国产精品伦一区二区,66精品视频在线观看,一区二区电影

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

EP3BB3編程代寫、C++程序設計代做
EP3BB3編程代寫、C++程序設計代做

時間:2025-01-15  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



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. 

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp





 

掃一掃在手機打開當前頁
  • 上一篇:優易花唄客服電話在線解決客戶強制下款問題!
  • 下一篇:防靜電門禁系統-ESD防靜電門禁工程方案-蘇州訊諾
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产精品社区| 一区二区精彩视频| 视频一区中文字幕国产| 97久久综合精品久久久综合| 四虎地址8848精品| 亚洲激情欧美| 国产精品玖玖玖在线资源| 麻豆成人av在线| 日韩久久久久| 黄色一区二区三区四区| 国产欧美88| 国产精品亚洲一区二区在线观看 | 天堂av在线一区| 加勒比色综合久久久久久久久| 欧美黄色一区| 国产91亚洲精品久久久| 蜜臀va亚洲va欧美va天堂| 久久精品主播| www.亚洲一二| 日韩av字幕| 中文成人在线| 国产精品一二| 日韩一区二区三区在线免费观看| 在线亚洲一区| 国产综合精品| 99精品视频在线| 国产日韩一区二区三免费高清| 久久香蕉精品香蕉| 美女视频一区在线观看| 韩国精品主播一区二区在线观看| 日韩中文欧美在线| aa亚洲婷婷| 国产精品97| 99久久夜色精品国产亚洲1000部| 北条麻妃在线一区二区免费播放 | 日韩伦理视频| 91麻豆精品国产91久久久平台 | 欧美精品一二| 久久九九免费| 狼人精品一区二区三区在线| 日韩在线精品强乱中文字幕| 精品一区二区三区中文字幕| 亚洲人成人一区二区三区| 国产精品一区毛片| 日韩美女在线| 成人在线免费av| 国产91在线精品| 亚洲综合av一区二区三区| 五月天国产在线| 日韩欧美午夜| 国产极品久久久久久久久波多结野| 日韩在线观看电影完整版高清免费悬疑悬疑| 免费成人av在线播放| 免费成人美女在线观看| 日韩av二区| 手机在线观看av网站| 日韩欧美伦理| 懂色aⅴ精品一区二区三区| 成人在线视频免费| 国产精品尤物| 亚洲我射av| 久久99国产成人小视频| 日本一不卡视频| 美国十次综合久久| 欧洲亚洲成人| 不卡在线一区二区| 国产一区二区高清| 三级欧美在线一区| 天堂8中文在线最新版在线| 日韩中字在线| 美女视频黄免费的久久| 看片网站欧美日韩| 亚洲精品中文字幕99999| 亚洲五码在线| 久久国产亚洲| 美女网站久久| 精精国产xxxx视频在线播放| 美女国产一区二区三区| 欧美精品aa| 西野翔中文久久精品国产| 精品久久97| 欧美精品一二| 国产精品精品| 美女网站视频久久| 综合伊思人在钱三区| 精品久久久久久久久久久aⅴ| 欧洲激情综合| 天堂中文在线播放| 麻豆中文一区二区| 日韩精品中文字幕吗一区二区| 国内精品偷拍| 噜噜噜91成人网| 日韩欧美三区| 国产欧美日韩精品一区二区免费| 精品国产乱码久久久久久1区2匹| 91精品电影| 中文字幕在线视频久| 一区二区三区四区五区精品视频| 高清一区二区| 久久99国产精品久久99大师| 中日韩视频在线观看| 亚洲精品成a人ⅴ香蕉片| 国产视频一区二| 久久激情电影| 漫画在线观看av| 欧美国产日本| 久久狠狠久久| 国产网站在线| 99精品美女视频在线观看热舞 | 国产成人tv| 玖玖视频精品| 蓝色福利精品导航| 欧美调教在线| www.youjizz.com在线| 欧美激情麻豆| 精品久久久久久久| 韩国久久久久久| 国产一区二区观看| 国产电影一区二区在线观看| 另类中文字幕国产精品| 日韩av不卡一区| 久久不射网站| 一区二区电影| 亚洲精品一区二区妖精| 精品久久福利| 久久国产精品色av免费看| 日韩激情在线| 玖玖精品一区| 蜜臀精品一区二区三区在线观看 | 亚洲激情偷拍| 日韩精品电影在线| 日韩精品欧美| 欧美天堂一区二区| 欧美顶级毛片在线播放| 高清毛片在线观看| 欧美三级一区| 老司机一区二区三区| 欧美日韩亚洲一区三区| 国产99久久| 一区二区国产精品| 香蕉视频一区二区三区| 国产精品久久乐| 99久久精品网| 亚欧美中日韩视频| 亚洲精品二区三区| 日本不卡一区二区| 一级毛片免费高清中文字幕久久网| 99久久伊人| 久久黄色影院| 久久中文欧美| 亚洲欧洲日本一区二区三区| 亚洲日本久久| 亚洲精华国产欧美| 欧洲精品99毛片免费高清观看| 伊人久久婷婷| 欧美禁忌电影| 亚洲第一av| 色爱av综合网| 久久中文在线| 午夜一区不卡| 日韩欧美国产大片| 神马久久资源| 伊人春色精品| 9999在线精品视频| 国产精品久久占久久| 成人在线视频你懂的| 久久精品国产一区二区| 一级欧洲+日本+国产| 国产真实有声精品录音| 毛片电影在线| 欧美成人综合| 久久av影视| 青青草国产一区二区三区| 天天色天天射综合网| 国产探花一区| 视频二区不卡| 在线一区视频| 亚洲精品不卡在线观看| 日日摸夜夜添夜夜添国产精品 | 精品视频高潮| 久久久久97| 日韩欧美伦理| 亚洲精品91| 免费一级欧美片在线观看网站| 粉嫩91精品久久久久久久99蜜桃 | 日韩综合小视频| 93在线视频精品免费观看| 久久激情婷婷| 亚洲成人一品| 高清欧美日韩| 视频一区视频二区中文字幕| 国产精品调教视频| 国产激情一区| 亚洲www啪成人一区二区| 一本色道久久综合亚洲精品不卡| 精品午夜视频| 亚洲三级观看| 成人高清一区| 欧美韩国日本在线观看| 国产精品99久久|