285
社区成员
发帖
与我相关
我的任务
分享| The Link Your Class | <https://bbs.csdn.net/forums/MUEE308FZU202201 > |
|---|---|
| The Link of Requirement of This Assignment | https://bbs.csdn.net/topics/608734907 |
| The Aim of This Assignment | Slove the problem lab1_2 |
| MU STU ID and FZU STU ID | <20122616_832001208> |
| Personal Software Process Stages | Estimated Time/minutes | Completed Time/minutes |
|---|---|---|
| Planning | 30 | 30 |
| Estimate | 20 | 25 |
| Development | 30 | 30 |
| Analysis | 90 | 90 |
| Design Spec | 80 | 80 |
| Design Review | 30 | 30 |
| Coding Standard | 30 | 30 |
| Design | 30 | 30 |
| Coding | 30 | 30 |
| Code Review Planning | 40 | 40 |
| Test | 20 | 25 |
| Reporting | 35 | 40 |
| Test Report | 70 | 80 |
| Size Measurement | 30 | 40 |
| Postmortem&Process Improvement | 30 | 30 |
| total | 595 | 630 |
From all the programming language I have learned , I think the ideal programming language is c++. Because this programming problem is mainly object-oriented, and I have systematically learned it, so I use c++.

#include <stdio.h>
int main(){
int m=1;
double n=0;
long f;
switch(m){
case 0:
break;
case 1:
break;
case 2:
break;
default:
break;
}
switch(m){
case 0:
break;
case 1:
break;
default:
break;
}
if(m<0){
if(m<-1){}
else{}
}
else if(m>0){
if (m>2){}
else if (m==2) {}
else if (m>1) {}
else {}
}
else{
if(n!=0){}
else{}
}
return 0;
}
#include
#include
#include
using namespace std;
string keyword[]={"auto","break","case","char","const","continue","default","do",
"double","else","enum","extern","float","for","goto","if",
"int","long","register","return","short","signed","sizeof","stastic",
"struct","switch","typedef","union","unsigned","void","volatile","while"};
int main(){
int con=0;
string root;
cout<<"the .cpp file name you wanna in the same folder"<<endl;
cin>>root;
cout<<"what level of stastic you want(from 1 to 4)"<<endl;
cin>> con;
ifstream inFile,s1,s2;
inFile.open(root.c_str(),ios::in);
s1.open(root.c_str(),ios::in);
s2.open(root.c_str(),ios::in);
if(!inFile|| !s1 ||!s2){
cout <<"Check the Path of File !" << endl;
exit(0);
}
string str;
int total=32,numt=0; ;
int count[total] = {0};
while (getline (inFile, str)){
for(int m=0;m<total;m++){
int pos;
for(;;){
if(str.find(keyword[m]) != -1){
if(str.find("//") != -1) break;
else{
pos = str.find(keyword[i]);
count[m]++;
str = str.substr(pos + keyword[i].length(),str.length() - pos - keyword[m].length());
}
}
else break;
}
}
}
for(int n=0;n<total;n++){
if(count[n]!=0){
numt+=count[n];
}
}
int num[5]={25,2,6,15,9},hzc[3]={0,0,-1};
int struc[count[num[0]]]={0};
string pick[3]={"else if", "if","else"};
while (getline (s1, str)){
int pos;
for(;;){
if(str.find(keyword[num[1]]) != -1){
if(str.find("//") != -1) break;
else{
struc[hzc[0]]++;
break;
}
}
if(str.find(keyword[num[2]]) != -1){
if(str.find("//") != -1) break;
else{
hzc[0]++;
break;
}
}
if(str.find(pick[0]) != -1){
pos = str.find(pick[0]);
str = str.substr(pos + pick[0].length(),str.length() - pos - pick[0].length());
}
if(str.find(pick[1]) != -1){
if(str.find("//") != -1) break;
else{
hzc[1]++;
break;
}
}
else break;
}
}
int divide[hzc[1]]={0}, ely=0,eln=0;
while (getline (s2, str)){
int pos;
for(;;){
if(str.find(pick[0]) != -1){
if(str.find("//") != -1) break;
else{
divide[hzc[2]]++;
break;
}
}
if(str.find(keyword[num[3]]) != -1){
if(str.find("//") != -1) break;
else{
hzc[2]++;
break;
}
}
else break;
}
}
for(int m=0;m<hzc[1];m++){
if(divide[m]==0){
eln++;
}
else{
ely++;
}
}
for(int o=1; o<con+1; o++){
switch(o){
case 1:
cout<<"total num is: "<<numt<<endl;
for(int j=0;j<total;j++){
if(count[j]!=0){
cout<<keyword[j]<<" num: "<<count[j]<<endl;
}
}
break;
case 2:
if(count[num[0]]!=count[num[2]]){
cout<<" wrong switch structure"<<endl;
}
else{
cout<<"The number of switch structure is:"<<count[num[0]]<<endl;
for(int k=0;k<count[num[0]];k++){
cout<<"switch "<<k+1<<" number of case is: "<<struc[k]<<endl;
}
}
break;
case 3:
cout<<"the number of if-else: "<<eln<<endl;
break;
case 4:
cout<<"the number of if-else if-else: "<<ely<<endl;
break;
default:
cout<<"false"<<endl;
}
}
inFile.close();
s1.close();
s2.close();
return 0;
}

This is the first time in my life I've ever used a PSP form. I find that the actual completion time is almost always longer than my estimated time, so I think my ability needs to be improved, which needs training. I use c++ because I have a good command of it. The use of flow chart has given me great benefits, I can clearly understand the before and after and logical relationship between the steps. I searched for a lot of relevant code, which helped me with my programming to some extent, but I still needed to compile and revise the code to achieve the desired effect.
很不错的内容,干货满满,已支持师傅,期望师傅能输出更多干货,并强烈给师傅五星好评
另外,如果可以的话,期待师傅能给正在参加年度博客之星评选的我一个五星好评,您的五星好评都是对我的支持与鼓励(帖子中有大额红包惊喜哟,不要忘记评了五星后领红包哟)
⭐ ⭐ ⭐ ⭐ ⭐ 博主信息⭐ ⭐ ⭐ ⭐ ⭐
博主:橙留香Park
本人原力等级:5
链接直达:https://bbs.csdn.net/topics/611387568
微信直达:Blue_Team_Park
⭐ ⭐ ⭐ ⭐ ⭐ 五星必回!!!⭐ ⭐ ⭐ ⭐ ⭐
点赞五星好评回馈小福利:抽奖赠书 | 总价值200元,书由君自行挑选(从此页面参与抽奖的同学,只需五星好评后,参与抽奖)