EE308 lab1-2

EE308 Lab1-2

The Link Your Classhttps://bbs.csdn.net/forums/MUEE308FZU202201?category=0&typeId=519086
The Link of Requirement of This Assignmenthttps://bbs.csdn.net/topics/608734907
The Aim of This Assignmentlearn how to use github&writing code
MU STU ID and FZU STU ID20124104_832001205
GitHub repository

https://github.com/xxxxxxqiu/demo

PSP

Personal Software Process StagesEstimated Time/minutesCompleted Time/minutes
Planning6060
Estimate27404200
Development720540
Analysis3601440
Design Spec3060
Design Review3060
Coding Standard2030
Design120200
Coding720540
Code Review Planning360720
Test80160
Reporting100180
Test Report6080
Size Measurement2030
Postmortem&Process Improvement60100
total27404200

Problem-solving ideas

Create a github account

  • Tip:Log in github by connecting your computer to your mobile hotspot. Do not use campus wifi.
  • Create an account on github
    https://github.com/

Download Git Bash and Initialize

  • how to download git bash
  • Initialize
    • Tip: Use local disk (E:) to operate. When I perform the command “git push” on disk (D:) , the repository name and branch name are correct but the operation fails. However, disk (E:) is feasible.
    • set user
      In the git bash command box, input:
      git config --global user.name “Your Name”
      git config --global user.email “email@example.com”
    • Perform the following operations in an empty local file:
      请添加图片描述

Create repository

  • 在这里插入图片描述
  • Simply name the repository and select public to create it

Establish a connection between repository and the local warehouse

  • how to make a connection
  • Using SSH Connection
    Input the command:$ git remote add + name of repository + add
    add is 👇
    请添加图片描述

Writing code

-------------------------------------------just write------------------------------------------

Use github for version control

  • Put the code file inside the initialized file请添加图片描述
  • input command:请添加图片描述
  • input command:git commit -m “what you want to note”
    请添加图片描述
  • then:请添加图片描述
  • now you can see the change in your github.com请添加图片描述

Design&Implementation

请添加图片描述

Key code modules

int main() {
	string s1 = "abcjkkjkjjdef";
	string s2 = "de";
	int ans = s1.find(s2,3);//从S1的第二个字符开始查找子串S2
	cout << ans << endl;//find():输出为s2在s1中出现的位置
	return 0;
}
int correspond( char le )         //是否为字母
{
	if( ( le >= 'a' && le <= 'z' ) || ( le >= 'A' && le <= 'Z' ) )
		return 1;
	else
		return 0;       
}
int judge( string s1 , string s2 )  //函数:判断s1中是否有s2,若有,则返回1
{
	int w( char str );     //
	int pos = s1.find( s2 , 0 );    //找b在a中出现的位置
	int len = s2.length();         //len为b长度
	if( pos != string::npos )     //若a里找得到b
	{
		if( pos == 0 )            //出现位置为0
		{
			if(w( s1[ pos + len ] ) == 0 )//最后一个字符+1为空
				return 1;         //返回1
			else 
				return 0;         //       
		}
		else                   //出现为其他位置
		{
			if(w( s1[ pos + len] ) == 0 && w( s1[ pos - 1] ) == 0 ) // b前后都为空
				return 1;        
			else
				return 0;   
		}
	}
	return 0;                 
}

Test

  • The first time I tried to write a program that counted the total number of keywords. However, since only whitespace is taken into account, the total is the number of whitespace separated strings in a cpp file.
    请添加图片描述
  • correct:
    请添加图片描述

Summarize

In this experiment, I learned github and how to use github for version control. Also, I reviewed the knowledge of c++.

1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看REAdMe.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看REAdMe.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看READme.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值