Skip to content

Commit

Permalink
Add a feature for Question/Answer from user
Browse files Browse the repository at this point in the history
  • Loading branch information
sinalalebakhsh committed Oct 27, 2023
1 parent e2f8851 commit db119f8
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
14 changes: 14 additions & 0 deletions GetUserInput/GetUserInput.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,20 @@ func IfUsris2orMoreWords(SliceOfWords []string) bool {
return false
}
}

for Index := range features.QuestionsSample.MapQuestionsSample {
if result == Index && lastElement == "question" {
words := features.SplitIntoWords(features.Questions.SingleQues[result])
features.PrintWordByWord(words)
fmt.Println()
color.HiBlue(fmt.Sprintln("============================================◉❓❓❓❓❓❓❓◉=========================================="))
color.HiBlue(fmt.Sprintln(features.QuestionsSample.MapQuestionsSample[Index]))
color.HiBlue(fmt.Sprintln("============================================◉❓❓❓❓❓❓❓◉=========================================="))
return false
}
}


return true
}

Expand Down
11 changes: 11 additions & 0 deletions features/Questions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package features

type AllQuestions struct {
SingleQues map[string]string
}

var Questions = AllQuestions{
SingleQues: map[string]string{
"operator":"The cars are produced on an assembly line. The assembly line has a certain speed, that can be changed. The faster the assembly line speed is, the more cars are produced. However, changing the speed of the assembly line also changes the number of cars that are produced successfully, that is cars without any errors in their production. Implement a function that takes in the number of cars produced per hour and the success rate and calculates the number of successful cars made per hour. The success rate is given as a percentage, from 0 to 100:",
},
}
15 changes: 15 additions & 0 deletions features/QuestionsSample.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package features

type QuestionsSampleStruct struct {
MapQuestionsSample map[string]string
}


var QuestionsSample = QuestionsSampleStruct {
MapQuestionsSample: map[string]string{
"operator":`Sample:
CalculateWorkingCarsPerHour(1547, 90)
expect:
// => 1392.3`,
},
}
6 changes: 3 additions & 3 deletions mergeToMain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
echo -n "Git push on branch develop "
echo ""
git add .
git commit -m " arithmetic operations on different types "
git commit -m " Add a feature for Question/Answer from user "
git push -u origin develop
echo "====================================================================="
echo -n "git checkout beforeMergeToMain "
Expand All @@ -16,7 +16,7 @@ echo "====================================================================="
echo -n "Git is Push for beforeMergeToMain "
echo ""
git add .
git commit -m " arithmetic operations on different types "
git commit -m " Add a feature for Question/Answer from user "
git push -u origin beforeMergeToMain
echo "====================================================================="
echo -n "git checkout main "
Expand All @@ -34,7 +34,7 @@ echo "====================================================================="
echo -n "Git is Push for main "
echo ""
git add .
git commit -m " arithmetic operations on different types "
git commit -m " Add a feature for Question/Answer from user "
git push -u origin main
echo "====================================================================="
echo -n "git checkout develop "
Expand Down

0 comments on commit db119f8

Please sign in to comment.